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
cee4f54
commit 87a944b
Showing
2 changed files
with
37 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
#!/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 | ||
|
||
# Navigate to the application folder | ||
cd "$(dirname "$0")" | ||
|
||
# Check if NVM (Node Version Manager) is installed | ||
if ! command -v nvm &> /dev/null | ||
then | ||
echo "NVM not found, installing..." | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
fi | ||
|
||
# Load NVM into the current shell session | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
|
||
# Install Node.js locally using NVM | ||
nvm install 18.17.1 | ||
nvm use 18.17.1 | ||
|
||
# Install npm dependencies | ||
echo "Installing npm dependencies..." | ||
npm i -g pnpm && pnpm install | ||
|
||
# Run the Next.js development server | ||
echo "Starting Next.js..." | ||
pnpm dev |