Update install.sh

This commit is contained in:
colin 2024-12-12 10:48:57 -05:00
parent d13a679438
commit 6284d584de
1 changed files with 29 additions and 18 deletions

View File

@ -14,30 +14,41 @@ fi
cd ~/Documents/OpenSCAD/libraries/
if ! [ -d "BOSL2" ]; then
git clone https://github.com/BelfrySCAD/BOSL2.git
else
cd BOSL2
git pull
cd ..
fi
declare -A libraries=(
["BOSL2"]="https://github.com/BelfrySCAD/BOSL2.git"
["BOSL"]="https://github.com/revarbat/BOSL.git"
["MCAD"]="https://github.com/openscad/MCAD.git"
["BOLTS"]="https://github.com/boltsparts/BOLTS.git"
["nutsnbolts"]="https://github.com/JohK/nutsnbolts.git"
["openscad-fillets"]="https://github.com/jfhbrook/openscad-fillets.git"
["openscad-model-library"]="https://github.com/cznewt/openscad-model-library.git"
["OpenSCAD-Arduino-Mounting-Library"]="https://github.com/kellyegan/OpenSCAD-Arduino-Mounting-Library.git"
["BezierScad"]="https://github.com/chadkirby/BezierScad.git"
["OpenSCAD-Track"]="https://github.com/joostn/OpenSCAD-Track.git"
["Chamfers-for-OpenSCAD"]="https://github.com/SebiTimeWaster/Chamfers-for-OpenSCAD.git"
["openjscad-u-joints"]="https://github.com/celer/openjscad-u-joints.git"
)
if ! [ -d "BOSL" ]; then
git clone https://github.com/revarbat/BOSL.git
else
cd BOSL
for lib in "${!libraries[@]}"; do
if ! [ -d "$lib" ]; then
git clone "${libraries[$lib]}"
else
cd "$lib"
git pull
cd ..
fi
fi
done
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."
for lib in "${!libraries[@]}"; do
if [ ! -d "$lib" ]; then
echo "Library $lib setup failed. Verify git and directory permissions."
exit 1
fi
fi
done
echo "OpenSCAD and libraries successfully installed and configured."