-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.py
42 lines (31 loc) · 867 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
35
36
37
38
39
40
41
42
import PyInstaller.__main__
import os
import sys
import time
import platform
print(f'platform: {platform.system()}')
options = [
'src/main.py',
'--icon=src/assets/images/icon_256x256.ico',
f'--add-data=src/assets{os.pathsep}assets',
'--name=wme',
'--onefile',
]
debug = False
args = sys.argv
if len(args) > 1:
args = args[1:]
for index in range(len(args)):
arg = args[index]
if arg in ['-d', '--debug']:
debug = True
elif arg in ['-o', '--output']:
options.append(f"--distpath={os.path.join('./dist', args[index + 1])}")
options.append(f"--workpath={os.path.join('./build', args[index + 1])}")
if debug:
options.append('--console')
else:
options.append('--windowed')
print(f'{options = }')
# time.sleep(1)
PyInstaller.__main__.run(options)