-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.py
45 lines (32 loc) · 850 Bytes
/
make.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import sys
import os
import subprocess as sp
EXECUTABLE = "genpass.py"
PATH = os.path.join(os.getcwd())
VENV = "/bin/activate"
def activate():
sp.call(["source", f"{PATH}/{VENV}"])
# os.system(f"source {PATH}/{VENV}")
def clean():
sp.call(["rm", "-r", "build"])
sp.call(["rm", "-r", "dist"])
sp.call(["rm", "-r", "__pycache__"])
sp.call(["rm", "genpass.spec"])
def compile():
sp.call(["pyinstaller", "-F", "-noconsole", EXECUTABLE])
def main(args: list):
if len(args) > 0:
if args[0] == "compile":
compile()
elif args[0] == "activate":
activate()
elif args[0] == "clean":
clean()
else:
print("Task not found :(")
else:
print("Error:")
if __name__ == '__main__':
args = sys.argv
del args[0]
main(args)