Warning
these setup instructions are intended for MacOS (ideally ARM-based) users only.
The setup.sh
script is a utility script that installs the necessary tools and software packages for Numanac development. To run the script, use the following command in your terminal (from the project root directory):
chmod +x utils/setup.sh && ./utils/setup.sh
Homebrew is a package manager for MacOS. The script checks if Homebrew is installed, and if not, it installs Homebrew.
if ! command -v brew &>/dev/null; then
echo "Homebrew not found. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || { echo "ERROR: Homebrew installation failed."; exit 1; }
echo "Homebrew installed successfully."
else
echo "Homebrew is already installed."
brew update || { echo "ERROR: Homebrew update failed."; exit 1; }
fi
Tip
If Homebrew is already installed, the script will update it to the latest version.
The script installs Visual Studio Code, Git, GitHub CLI, wget, and Docker using Homebrew.
echo "Installing necessary software using Homebrew..."
brew install --cask visual-studio-code || { echo "ERROR: VSCode installation failed."; exit 1; }
brew install git gh wget docker || { echo "ERROR: Software installation failed."; exit 1; }
echo "Software installed successfully."
NVM (Node Version Manager) is installed, followed by Node.js.
echo "Setting up nvm (Node Version Manager)..."
wget -qO- "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh" | bash || { echo "ERROR: nvm installation failed."; exit 1; }
source "$HOME/.nvm/nvm.sh"
nvm install node || { echo "ERROR: Node.js installation failed."; exit 1; }
nvm use node
echo "nvm and Node.js setup completed."
Tip
Make sure to source the nvm script to ensure NVM is properly set up.
GitHub authentication is handled via the GitHub CLI.
echo "Authenticating with GitHub..."
echo "Please follow the prompts to authenticate with GitHub."
gh auth login || { echo "ERROR: GitHub authentication failed."; exit 1; }
echo "GitHub authentication successful."
Important
Follow the prompts to authenticate with GitHub to ensure you have access to necessary repositories.
The script clones the Numanac repository from GitHub.
echo "Cloning the Numanac repository..."
git clone "https://github.com/numanac/numanac.git" || { echo "ERROR: Failed to clone the repository."; exit 1; }
cd "numanac" || { echo "ERROR: Failed to change directory to numanac."; exit 1; }
echo "Repository cloned and directory changed successfully."
The script opens the Numanac project in Visual Studio Code.
echo "Opening the project in VSCode..."
code . || { echo "ERROR: Failed to open VSCode."; exit 1; }
echo "Project opened in VSCode successfully."
Navigate to the docs
directory and launch the documentation site.
echo "Launching the Numanac documentation site..."
cd "./docs" || { echo "ERROR: Failed to change directory to ./docs."; exit 1; }
npm install || { echo "ERROR: npm install failed."; exit 1; }
npm start || { echo "ERROR: Failed to launch the documentation site."; exit 1; }
echo "Documentation site launched successfully at http://localhost:3000."