-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.py
45 lines (35 loc) · 892 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
43
44
45
import PyInstaller.__main__
import platform
def build_for_current_platform():
system = platform.system().lower()
if system == "windows":
build_for_windows()
elif system == "darwin":
build_for_mac()
elif system == "linux":
build_for_linux()
else:
print(f"Unsupported platform: {system}")
def build_for_windows():
PyInstaller.__main__.run([
'./api/main.py',
'--onefile',
'--name=aichat',
'--add-data=.env:.',
])
def build_for_mac():
PyInstaller.__main__.run([
'./api/main.py',
'--onefile',
'--name=aichat',
'--add-data=.env:.',
])
def build_for_linux():
PyInstaller.__main__.run([
'./api/main.py',
'--onefile',
'--name=aichat',
'--add-data=.env:.',
])
if __name__ == "__main__":
build_for_current_platform()