-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-db.bat
More file actions
33 lines (30 loc) · 927 Bytes
/
setup-db.bat
File metadata and controls
33 lines (30 loc) · 927 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
@echo off
setlocal
set "SCRIPT_DIR=%~dp0"
set "PORTABLE_NODE=%SCRIPT_DIR%dist\nodejs"
where npm >nul 2>&1
if %errorlevel% neq 0 (
if exist "%PORTABLE_NODE%\node.exe" (
if exist "%PORTABLE_NODE%\node_modules\npm\bin\npm-cli.js" (
set "PATH=%PORTABLE_NODE%;%PATH%"
echo Using portable Node.js from dist\nodejs
) else (
echo ERROR: dist\nodejs is incomplete - missing node_modules\npm
echo Run: .\setup-portable-nodejs.ps1 to download complete Node.js
echo Or install Node.js from nodejs.org
exit /b 1
)
) else (
echo ERROR: npm not found. Install Node.js from nodejs.org or run .\setup-portable-nodejs.ps1
exit /b 1
)
)
echo Setting up database...
call npm run setup-db
if %errorlevel% neq 0 (
echo Error setting up database
pause
exit /b %errorlevel%
)
echo Database setup complete!
pause