generated from Blazity/next-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2b0587
commit ca64203
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Prompt for environment variables | ||
read -p "Please enter the DATA_ENDPOINT: " DATA_ENDPOINT | ||
read -p "Please enter the NEXT_PUBLIC_MAPBOX_TOKEN: " NEXT_PUBLIC_MAPBOX_TOKEN | ||
|
||
# Create or update the .env file | ||
echo "DATA_ENDPOINT=$DATA_ENDPOINT" > .env | ||
echo "NEXT_PUBLIC_MAPBOX_TOKEN=$NEXT_PUBLIC_MAPBOX_TOKEN" >> .env | ||
|
||
# Check if Node.js is installed | ||
if ! command -v node &> /dev/null | ||
then | ||
echo "Node.js not found, installing..." | ||
curl -o nodejs.pkg https://nodejs.org/dist/v18.17.1/node-v18.17.1.pkg | ||
sudo installer -pkg nodejs.pkg -target / | ||
rm nodejs.pkg | ||
fi | ||
|
||
# Navigate to the application folder | ||
cd "$(dirname "$0")" | ||
|
||
# Install npm dependencies | ||
echo "Installing npm dependencies..." | ||
npm install | ||
|
||
# Run the Next.js development server | ||
echo "Starting Next.js..." | ||
npm run dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@echo off | ||
SETLOCAL | ||
|
||
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 Check if Node.js is installed | ||
where node >nul 2>&1 | ||
IF %ERRORLEVEL% NEQ 0 ( | ||
echo Installing Node.js... | ||
curl -o nodejs.msi https://nodejs.org/dist/v18.17.1/node-v18.17.1-x64.msi | ||
start /wait msiexec /i nodejs.msi /quiet /norestart | ||
del nodejs.msi | ||
) | ||
|
||
REM Navigate to the application folder | ||
cd /d "%~dp0" | ||
|
||
REM Install npm dependencies | ||
echo Installing npm dependencies... | ||
npm install | ||
|
||
REM Run the Next.js development server | ||
echo Starting Next.js... | ||
npm run dev | ||
|
||
ENDLOCAL | ||
pause |