Skip to content

Commit 5e52cda

Browse files
authored
Create cli.py
1 parent fe86b0a commit 5e52cda

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

clis/cli.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import sys
2+
import subprocess
3+
from pathlib import Path
4+
import os
5+
6+
ROOT_DIR = Path(__file__).parent.parent
7+
8+
if len(sys.argv) > 1 and sys.argv[1] == "compile":
9+
subprocess.run(
10+
[sys.executable, "-m", "pip", "install", "pyinstaller"],
11+
check=True
12+
)
13+
14+
subprocess.run(
15+
[
16+
sys.executable,
17+
"-m",
18+
"PyInstaller",
19+
"--onefile",
20+
"--hidden-import=pyos_gaps",
21+
str(ROOT_DIR / "main.py"),
22+
"--name=pythonos",
23+
],
24+
check=True
25+
)
26+
27+
print("Compilazione completata! Si trova in:", end=" ")
28+
29+
if os.name == "nt":
30+
print(ROOT_DIR / "dist" / "pythonos.exe")
31+
else:
32+
print(ROOT_DIR / "dist" / "pythonos")
33+
34+
else:
35+
print("CLI PythonOS")

0 commit comments

Comments
 (0)