2024-05-02 19:39:31 +00:00
|
|
|
import subprocess
|
|
|
|
import sys
|
2024-05-02 19:51:08 +00:00
|
|
|
from pathlib import Path
|
2024-05-02 19:39:31 +00:00
|
|
|
|
|
|
|
from virtualenv import cli_run
|
2024-04-29 22:47:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
def main() -> None:
|
2024-05-02 19:39:31 +00:00
|
|
|
# TODO location
|
2024-05-02 19:51:08 +00:00
|
|
|
venv_path = Path("/") / "tmp" / "kiwi"
|
|
|
|
bin_path = venv_path / "bin"
|
|
|
|
|
|
|
|
if not (bin_path / "kiwi-core").exists():
|
|
|
|
cli_run([str(venv_path)])
|
|
|
|
subprocess.check_call([bin_path / "python3", "-m", "pip", "install", "."])
|
2024-05-02 19:39:31 +00:00
|
|
|
|
|
|
|
try:
|
2024-05-02 19:51:08 +00:00
|
|
|
subprocess.check_call([bin_path / "kiwi-core", *sys.argv[1::]])
|
2024-05-02 19:39:31 +00:00
|
|
|
except subprocess.CalledProcessError as exc:
|
|
|
|
sys.exit(exc.returncode)
|
2024-04-29 22:47:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|