Skip to content

Commit

Permalink
setup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Aug 22, 2024
1 parent b2b0587 commit ca64203
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
29 changes: 29 additions & 0 deletions setup-macos.sh
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
33 changes: 33 additions & 0 deletions setup-windows.bat
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

0 comments on commit ca64203

Please sign in to comment.