diff --git a/install.sh b/install.sh index dd1eb34..78f1204 100644 --- a/install.sh +++ b/install.sh @@ -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 - git pull - cd .. -fi +for lib in "${!libraries[@]}"; do + if ! [ -d "$lib" ]; then + git clone "${libraries[$lib]}" + else + cd "$lib" + git pull + cd .. + 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." - exit 1 -fi +for lib in "${!libraries[@]}"; do + if [ ! -d "$lib" ]; then + echo "Library $lib setup failed. Verify git and directory permissions." + exit 1 + fi +done echo "OpenSCAD and libraries successfully installed and configured." \ No newline at end of file