Add install.sh

This commit is contained in:
colin 2024-12-12 10:43:10 -05:00
commit ee9e05bed3
1 changed files with 43 additions and 0 deletions

43
install.sh Normal file
View File

@ -0,0 +1,43 @@
#!/bin/bash
if ! command -v brew >/dev/null 2>&1; then
echo "Homebrew is not installed. Please install Homebrew first: https://brew.sh/"
exit 1
fi
if ! brew list openscad >/dev/null 2>&1; then
brew install openscad
fi
if ! [ -d ~/Documents/OpenSCAD/libraries/ ]; then
mkdir -p ~/Documents/OpenSCAD/libraries/
fi
cd ~/Documents/OpenSCAD/libraries/
if ! [ -d "BOSL2" ]; then
git clone https://github.com/BelfrySCAD/BOSL2.git
else
cd BOSL2
git pull
cd ..
fi
if ! [ -d "BOSL" ]; then
git clone https://github.com/revarbat/BOSL.git
else
cd BOSL
git pull
cd ..
fi
if ! command -v openscad >/dev/null 2>&1; then
echo "OpenSCAD installation failed. Please verify your Homebrew setup."
exit 1
fi
if [ ! -d ~/Documents/OpenSCAD/libraries/BOSL2 ] || [ ! -d ~/Documents/OpenSCAD/libraries/BOSL ]; then
echo "Library setup failed. Verify git and directory permissions."
exit 1
fi
echo "OpenSCAD and libraries successfully installed and configured."