Сборка
Last updated
Last updated
#!/bin/zsh
# Step 1: Install nvm
echo "Installing nvm..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
# Step 2: Update .zshrc with nvm configurations
echo "Updating .zshrc with nvm configurations..."
echo '\nexport NVM_DIR="$HOME/.nvm"' >> ~/.zshrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.zshrc
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.zshrc
# Inform user to refresh their zsh session manually
echo "Please run 'source ~/.zshrc' to refresh your session, or restart your terminal, then run this script again."
source ~/.zshrc
# Check if NVM is loaded; if not, exit
if [ -z "$NVM_DIR" ]; then
echo "NVM is not installed or not loaded. Please ensure NVM is properly set up."
exit 1
fi
# Step 3: Install and use Node.js version 16
echo "Installing Node.js version 16..."
nvm install 16
nvm use 16
# Step 4: Download BloodHound source code
echo "Downloading BloodHound source code..."
wget https://github.com/BloodHoundAD/BloodHound/archive/refs/tags/v4.3.1.zip
# Step 5: Unzip and prepare BloodHound
echo "Preparing BloodHound..."
unzip v4.3.1.zip
cd BloodHound-4.3.1
# Step 6: Build BloodHound
echo "Building BloodHound..."
sudo npm ci
sudo npm run build
# Final instructions
echo "BloodHound has been built. To run it, navigate to:"
echo "~/BloodHound-4.3.1/BloodHound-darwin-arm64/BloodHound.app/Contents/MacOS"
echo "And execute ./BloodHound"