-
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.
Merge pull request #2 from christian-byrne/grade-scripts
Update startup scripts and README
- Loading branch information
Showing
3 changed files
with
88 additions
and
14 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
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 |
---|---|---|
@@ -1,6 +1,36 @@ | ||
#!/bin/bash | ||
|
||
sudo apt update | ||
|
||
# Function to install Node.js and npm | ||
install_node_npm() { | ||
echo "Node.js and npm not found. Installing..." | ||
# Add NodeSource repository and install Node.js (this installs npm automatically) | ||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - | ||
sudo apt install -y nodejs | ||
echo "Node.js and npm installed successfully." | ||
} | ||
|
||
# Check if Node.js is installed | ||
if ! command -v node &> /dev/null; then | ||
install_node_npm | ||
else | ||
echo "Node.js is already installed. Version: $(node -v)" | ||
fi | ||
|
||
# Check if npm is installed | ||
if ! command -v npm &> /dev/null; then | ||
echo "npm not found, but Node.js is installed. Installing npm..." | ||
sudo apt install -y npm | ||
echo "npm installed successfully." | ||
else | ||
echo "npm is already installed. Version: $(npm -v)" | ||
fi | ||
|
||
# Start the wiki server | ||
# https://github.com/smlhelp/book | ||
npm install | ||
npm start | ||
|
||
# Open the wiki in the default web browser | ||
xdg-open http://localhost:3000/book/ |
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