-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.bat
More file actions
36 lines (28 loc) · 742 Bytes
/
run.bat
File metadata and controls
36 lines (28 loc) · 742 Bytes
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
@echo off
setlocal EnableDelayedExpansion
:: Step 1: Check if the virtual environment directory exists
if not exist "venv" (
echo Creating virtual environment...
python -m venv venv
) else (
echo Virtual environment already exists
)
:: Step 2: Activate the virtual environment
call .\venv\Scripts\activate
:: Step 3: Install dependencies
pip install -r requirements.txt
:: Define a label to handle cleanup
:cleanup
if defined CLEANUP (
echo Cleaning up...
:: Deactivate the virtual environment
call .\venv\Scripts\deactivate
exit /B 0
)
:: Step 5: Run the server
set CLEANUP=1
python server\main.py --prod
:: Step 6: Deactivate the virtual environment
set CLEANUP=
call .\venv\Scripts\deactivate
exit /B 0