-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.bat
87 lines (68 loc) · 1.55 KB
/
start.bat
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@echo off
setlocal
set NODE_ENV=production
set PUBLIC_URL=/build
if "%AUGMENTATION_SERVICE_URL_SCHEME%"=="" (
set AUGMENTATION_SERVICE_URL_SCHEME=http
)
if "%AUGMENTATION_SERVICE_HOST%"=="" (
set AUGMENTATION_SERVICE_HOST=127.0.0.1
)
if "%AUGMENTATION_SERVICE_PORT%"=="" (
set AUGMENTATION_SERVICE_PORT=5000
)
if "%DISABLE_AUTO_OPEN%"=="" (
set DISABLE_AUTO_OPEN=0
)
if "%API_ONLY%"=="" (
set API_ONLY=0
)
if "%THREAD_COUNT%"=="" (
set THREAD_COUNT=6
)
if not exist venv (
call python -m venv venv
) else (
echo Virtual environment already created. Skipping creation.
)
call venv\Scripts\activate
if "%API_ONLY%"=="0" (
cd client
if not exist node_modules (
call npm install
if errorlevel 1 (
echo npm install failed
pause
exit /b 1
)
) else (
echo Node modules already installed. Skipping installation.
)
if not exist build (
call npm run build
if errorlevel 1 (
echo npm build failed
pause
exit /b 1
)
) else (
echo Build directory already exists. Skipping build.
)
cd ..
call python setup_client.py "client/build/index.html"
)
cd server
call pip install --upgrade -r requirements.txt
if errorlevel 1 (
echo pip install failed
pause
exit /b 1
)
if "%DISABLE_AUTO_OPEN%"=="0" (
if "%API_ONLY%"=="0" (
start %AUGMENTATION_SERVICE_URL_SCHEME%://%AUGMENTATION_SERVICE_HOST%:%AUGMENTATION_SERVICE_PORT%/
)
)
call python main.py
pause
endlocal