-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.py
39 lines (30 loc) · 1.13 KB
/
install.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
from _utilities import *
def install_frontend_dependencies():
"""
Install frontend JavaScript dependencies using npm.
"""
os.chdir(os.path.join(os.getcwd(), "client"))
print("Installing frontend dependencies using npm...")
run_command('npm install')
os.chdir("..")
def install_backend_dependencies():
"""
Set up a Python virtual environment and install backend dependencies.
"""
os.chdir('./server')
if not os.path.exists('venv'):
print("Setting up Python virtual environment...")
run_command('python3 -m venv venv')
print("Activating the virtual environment and installing backend dependencies...")
if sys.platform == "win32":
# Windows requires a different command to activate the virtual environment
run_command('.\\venv\\Scripts\\activate && pip install -r requirements.txt')
else:
# Linux and macOS use this command
run_command('. venv/bin/activate && pip install -r requirements.txt')
os.chdir("..")
def main():
install_frontend_dependencies()
install_backend_dependencies()
if __name__ == "__main__":
main()