From ee9e05bed339906a424e9182cfbc2c0a073eb142 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 12 Dec 2024 10:43:10 -0500 Subject: [PATCH] Add install.sh --- install.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 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