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