Update install.sh
This commit is contained in:
parent
158552a2d4
commit
f0348415df
46
install.sh
46
install.sh
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/zsh
|
||||||
|
|
||||||
if ! command -v brew >/dev/null 2>&1; then
|
if ! command -v brew >/dev/null 2>&1; then
|
||||||
echo "Homebrew is not installed. Please install Homebrew first: https://brew.sh/"
|
echo "Homebrew is not installed. Please install Homebrew first: https://brew.sh/"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -14,21 +15,36 @@ fi
|
||||||
|
|
||||||
cd ~/Documents/OpenSCAD/libraries/
|
cd ~/Documents/OpenSCAD/libraries/
|
||||||
|
|
||||||
declare -A libraries=(
|
# Separate arrays for library names and their corresponding URLs
|
||||||
["BOSL2"]="https://github.com/BelfrySCAD/BOSL2.git"
|
library_names=(
|
||||||
["BOSL"]="https://github.com/revarbat/BOSL.git"
|
"BOSL2"
|
||||||
["MCAD"]="https://github.com/openscad/MCAD.git"
|
"BOSL"
|
||||||
["nutsnbolts"]="https://github.com/JohK/nutsnbolts.git"
|
"MCAD"
|
||||||
["openscad-fillets"]="https://github.com/jfhbrook/openscad-fillets.git"
|
"nutsnbolts"
|
||||||
["openscad-model-library"]="https://github.com/cznewt/openscad-model-library.git"
|
"openscad-fillets"
|
||||||
["OpenSCAD-Arduino-Mounting-Library"]="https://github.com/kellyegan/OpenSCAD-Arduino-Mounting-Library.git"
|
"openscad-model-library"
|
||||||
["BezierScad"]="https://github.com/chadkirby/BezierScad.git"
|
"OpenSCAD-Arduino-Mounting-Library"
|
||||||
["Chamfers-for-OpenSCAD"]="https://github.com/SebiTimeWaster/Chamfers-for-OpenSCAD.git"
|
"BezierScad"
|
||||||
|
"Chamfers-for-OpenSCAD"
|
||||||
|
)
|
||||||
|
library_urls=(
|
||||||
|
"https://github.com/BelfrySCAD/BOSL2.git"
|
||||||
|
"https://github.com/revarbat/BOSL.git"
|
||||||
|
"https://github.com/openscad/MCAD.git"
|
||||||
|
"https://github.com/JohK/nutsnbolts.git"
|
||||||
|
"https://github.com/jfhbrook/openscad-fillets.git"
|
||||||
|
"https://github.com/cznewt/openscad-model-library.git"
|
||||||
|
"https://github.com/kellyegan/OpenSCAD-Arduino-Mounting-Library.git"
|
||||||
|
"https://github.com/chadkirby/BezierScad.git"
|
||||||
|
"https://github.com/SebiTimeWaster/Chamfers-for-OpenSCAD.git"
|
||||||
)
|
)
|
||||||
|
|
||||||
for lib in "${!libraries[@]}"; do
|
# Clone or update each library
|
||||||
|
for i in {1..${#library_names[@]}}; do
|
||||||
|
lib="${library_names[$i]}"
|
||||||
|
url="${library_urls[$i]}"
|
||||||
if ! [ -d "$lib" ]; then
|
if ! [ -d "$lib" ]; then
|
||||||
git clone "${libraries[$lib]}"
|
git clone "$url" "$lib"
|
||||||
else
|
else
|
||||||
cd "$lib"
|
cd "$lib"
|
||||||
git pull
|
git pull
|
||||||
|
@ -36,12 +52,14 @@ for lib in "${!libraries[@]}"; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Verify OpenSCAD installation
|
||||||
if ! command -v openscad >/dev/null 2>&1; then
|
if ! command -v openscad >/dev/null 2>&1; then
|
||||||
echo "OpenSCAD installation failed. Please verify your Homebrew setup."
|
echo "OpenSCAD installation failed. Please verify your Homebrew setup."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for lib in "${!libraries[@]}"; do
|
# Verify library setup
|
||||||
|
for lib in $library_names; do
|
||||||
if [ ! -d "$lib" ]; then
|
if [ ! -d "$lib" ]; then
|
||||||
echo "Library $lib setup failed. Verify git and directory permissions."
|
echo "Library $lib setup failed. Verify git and directory permissions."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue