-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.py
34 lines (30 loc) · 952 Bytes
/
build.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
"""
This is a build file that is completely seperate to the main codebase.
It is responsible for compiling the program for each platform.
"""
import sys
import PyInstaller.__main__
# allows specification of platforms
args: list[str] = sys.argv
match len(args):
case 0:
print("No python option specified: args is null")
sys.exit(1)
case 1:
print("No distribution option specified.")
sys.exit(1)
case 2:
if args[1] == "--dist":
print("No python distriution specified after --dist")
sys.exit(1)
print(f"Unknown argument: {args[1]}")
sys.exit(1)
case 3:
if args[1] != "--dist":
print(f"Unknown argument: {args[1]}")
sys.exit(1)
match args[2]:
case "linux":
PyInstaller.__main__.run(
["main.py", "--strip", "--onefile", "--upx-dir=/usr/local/share/"]
)