-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
58 lines (44 loc) · 1.42 KB
/
setup.py
File metadata and controls
58 lines (44 loc) · 1.42 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
import subprocess
import platform
class Colors:
CHOOSE_PLATFORM = "\u001b[34m"
VS2022 = "\u001b[35m"
VS2017 = "\u001b[33m"
MAKEFILE = "\u001b[32m"
OPTION = "\u001b[36m"
ERROR = "\u001b[31m"
options = [f"Visual Studio 2022{Colors.VS2017}", f"Visual Studio 2017{Colors.MAKEFILE}", f"Makefile {Colors.OPTION}"]
def choose_platform():
option = 1
print(f"{Colors.CHOOSE_PLATFORM}Choose platform:{Colors.VS2022}")
for i in options:
print(f"{option}: {i}")
option += 1
print("Enter number:", end=" ")
try:
option = input()
except KeyboardInterrupt:
print(f"\n{Colors.ERROR}Program force stopped by user")
exit()
try:
option = int(option)
if(option > len(options)):
try:
raise Exception()
except:
print(f"{Colors.ERROR}Please enter valid number")
exit()
except ValueError:
print(f"{Colors.ERROR}Please enter valid number")
exit()
if option == 1:
return "vs2022"
elif option == 2:
return "vs2017"
elif option == 3:
return "gmake"
selected_option = choose_platform()
if platform.system() == "Windows":
subprocess.run(f"start vendor/premake/premake5.exe {selected_option}", shell=True)
elif platform.system() == "Linux":
subprocess.run(f"./vendor/premake/premake5 {selected_option}", shell=True)