Skip to content

Commit ba1de0e

Browse files
authored
Update sudo_cli.py
1 parent 5e52cda commit ba1de0e

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

clis/sudo_cli.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,38 @@
99
1010
"""
1111

12-
print("Sudo CLI pin sviluppo.")
12+
import sys
13+
import subprocess
14+
from pathlib import Path
15+
import os
16+
17+
ROOT_DIR = Path(__file__).parent.parent
18+
19+
if len(sys.argv) > 1 and sys.argv[1] == "compile":
20+
subprocess.run(
21+
[sys.executable, "-m", "pip", "install", "pyinstaller"],
22+
check=True
23+
)
24+
25+
subprocess.run(
26+
[
27+
sys.executable,
28+
"-m",
29+
"PyInstaller",
30+
"--onefile",
31+
"--hidden-import=pyos_gaps",
32+
str(ROOT_DIR / "main.py"),
33+
"--name=pythonos",
34+
],
35+
check=True
36+
)
37+
38+
print("Compilazione completata! Si trova in:", end=" ")
39+
40+
if os.name == "nt":
41+
print(ROOT_DIR / "dist" / "pythonos.exe")
42+
else:
43+
print(ROOT_DIR / "dist" / "pythonos")
44+
45+
else:
46+
print("SUDO CLI PythonOS")

0 commit comments

Comments
 (0)