commit ee9e05bed339906a424e9182cfbc2c0a073eb142 Author: colin Date: Thu Dec 12 10:43:10 2024 -0500 Add install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..dd1eb34 --- /dev/null +++ b/install.sh @@ -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." \ No newline at end of file