-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
36 lines (27 loc) · 1.05 KB
/
setup.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
import sys
import time
import platform
import subprocess
def main():
os = platform.system()
try:
if os == 'Windows':
print("\nDetected Windows Operating System. Running setup.ps1...")
subprocess.run(['powershell', '-ExecutionPolicy', 'ByPass', '-File', 'src/setup.ps1'], check=True)
elif os == 'Linux' or os == 'Darwin':
print(f"\nDetected {os} Operating System. Running setup.sh...")
subprocess.run(['bash', 'src/setup.sh'], check=True)
else:
print(f"Unsupported Operating System: {os}. Unable to run the setup script.")
time.sleep(1)
print("Please refer to the Installation Guidelines for manual setup of the application.")
time.sleep(3)
sys.exit(1)
except subprocess.CalledProcessError as e:
print(f"\nError: Setup script failed with the error code {e.returncode}.")
sys.exit(1)
except Exception as e:
print(f"\nUnexpected error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()