2022-06-27 20:13:22 +03:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2022-09-30 11:40:22 +03:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2022-06-27 20:13:22 +03:00
|
|
|
import os
|
|
|
|
import pathlib
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
|
|
|
here = pathlib.Path(__file__).parent
|
|
|
|
|
|
|
|
|
|
|
|
def main(*args: str) -> int:
|
|
|
|
if len(args) == 0:
|
|
|
|
print("Parameters required")
|
|
|
|
return 1
|
|
|
|
|
|
|
|
if sys.platform == "win32":
|
|
|
|
script = "activated.ps1"
|
|
|
|
command = ["powershell", os.fspath(here.joinpath(script)), *args]
|
|
|
|
else:
|
|
|
|
script = "activated.sh"
|
2022-08-10 02:27:11 +03:00
|
|
|
command = ["sh", os.fspath(here.joinpath(script)), *args]
|
2022-06-27 20:13:22 +03:00
|
|
|
|
|
|
|
completed_process = subprocess.run(command)
|
|
|
|
|
|
|
|
return completed_process.returncode
|
|
|
|
|
|
|
|
|
|
|
|
sys.exit(main(*sys.argv[1:]))
|