From 0328ddcfa872bae58b47e3b6f586be6696013d90 Mon Sep 17 00:00:00 2001 From: Timothy Hofland Date: Wed, 11 Mar 2026 09:23:07 +0100 Subject: [PATCH] fix: harden ofxPiMapper paths and add defensive cloning for example-basic --- scripts/setup.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index c3a69ae..ae113e9 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -267,7 +267,9 @@ else fi cd "$REAL_HOME/openFrameworks/addons" - if [ ! -d "ofxPiMapper" ]; then + if [ ! -d "ofxPiMapper/example-basic" ]; then + echo "ofxPiMapper missing or incomplete. Cleaning and cloning..." + rm -rf ofxPiMapper sudo -u "$REAL_USER" git clone https://github.com/kr15h/ofxPiMapper.git fi @@ -283,10 +285,17 @@ else }' src/Osc/OscControl.cpp fi - cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example-basic" - sudo -u "$REAL_USER" make -j1 - cp bin/example-basic /usr/local/bin/ofxPiMapper - chmod +x /usr/local/bin/ofxPiMapper + echo "Compiling example-basic..." + if [ -d "example-basic" ]; then + cd "example-basic" + sudo -u "$REAL_USER" make -j1 + cp bin/example-basic /usr/local/bin/ofxPiMapper + chmod +x /usr/local/bin/ofxPiMapper + else + echo "ERROR: example-basic folder not found in ofxPiMapper addon!" + exit 1 + fi + fi fi