generated from Blazity/next-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-windows.bat
31 lines (24 loc) · 953 Bytes
/
setup-windows.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
@echo off
SETLOCAL
if exist .env (echo .env file exists, skipping prompts.) else (
REM Prompt for environment variables
set /p DATA_ENDPOINT=Please enter the DATA_ENDPOINT:
set /p NEXT_PUBLIC_MAPBOX_TOKEN=Please enter the NEXT_PUBLIC_MAPBOX_TOKEN:
REM Create or update the .env file
echo DATA_ENDPOINT=%DATA_ENDPOINT% > .env
echo NEXT_PUBLIC_MAPBOX_TOKEN=%NEXT_PUBLIC_MAPBOX_TOKEN% >> .env
)
REM Navigate to the application folder
cd /d "%~dp0"
REM Check if Node.js is locally installed
if not exist ".\node-v18.17.1-win-x64\node.exe" (
echo Downloading Node.js...
curl -o nodejs.zip https://nodejs.org/dist/v18.17.1/node-v18.17.1-win-x64.zip
tar -xf nodejs.zip
del nodejs.zip
)
REM Install npm dependencies
echo Installing npm dependencies and running application...
.\node-v18.17.1-win-x64\npm i -g pnpm && .\node-v18.17.1-win-x64\npx pnpm install && .\node-v18.17.1-win-x64\npx pnpm dev
ENDLOCAL
pause