31 lines
619 B
Python
Executable File
31 lines
619 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Compatibility entry point for pi-sbx-profile."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import shutil
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
ALIASES = {
|
|
"set-root": "set",
|
|
"unset-root": "unset",
|
|
}
|
|
|
|
|
|
def main() -> None:
|
|
executable = shutil.which("pi-sbx-profile")
|
|
if executable is None:
|
|
executable = str(Path(__file__).resolve().with_name("pi-sbx-profile.py"))
|
|
|
|
arguments = sys.argv[1:]
|
|
if arguments:
|
|
arguments[0] = ALIASES.get(arguments[0], arguments[0])
|
|
os.execv(executable, [executable, *arguments])
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|