forked from DelxHQ/Xenia-WebServices
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsetup.bat
59 lines (53 loc) · 1.14 KB
/
setup.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
@echo off
:MENU
cls
echo Choose an option:
echo ==========================
echo 1. Setup Server
echo 2. Start Server
echo 3. Exit
set /p choice=Enter your choice:
if "%choice%"=="1" goto SETUP_SERVER
if "%choice%"=="2" goto START_SERVER
if "%choice%"=="3" exit
goto MENU
:SETUP_SERVER
cls
echo ==========================
echo Setup Server
echo ==========================
echo Node.js version: & node --version
echo.
echo npm version: & call npm --version
echo.
pause
cls
echo Installing...
call npm install
echo.
echo Building...
call npm run build
echo.
:: Check if .env exists, just echo the result
if exist "%~dp0\.env" (
echo .env already exists. Skipping renaming.
) else (
echo .env does not exist. Renaming .env.template to .env...
if exist "%~dp0\.env.template" (
ren "%~dp0\.env.template" ".env"
echo .env.template renamed to .env successfully.
) else (
echo .env.template not found. Please check the setup.
)
)
echo.
echo Server setup completed.
pause
goto MENU
:START_SERVER
cls
echo ==========================
echo Starting Server...
echo ==========================
start cmd /k "npm run start"
exit