From c5b5b701efc1da62ae8a780f04adbe39e44e2ea1 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Wed, 15 Nov 2023 17:53:02 +0100 Subject: [PATCH] handle macdeployqt error, since it returns 0 even if it fails... --- scripts/macOS/internal/2a_appbundle.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/macOS/internal/2a_appbundle.sh b/scripts/macOS/internal/2a_appbundle.sh index 856fa5f4a..d7924fa7e 100644 --- a/scripts/macOS/internal/2a_appbundle.sh +++ b/scripts/macOS/internal/2a_appbundle.sh @@ -31,16 +31,20 @@ do ARGUMENTS="${ARGUMENTS} -executable=${plugin}" done -# Make sure that deploy succeeds -if ${QT_DIR}macdeployqt $INSTALL_PATH/$APPNAME \ - $ARGUMENTS; \ -then - # remove everything from install path, except the appbundle - cd $INSTALL_PATH - ls | grep -xv "${APPNAME}" | xargs rm +# save in message the output of macdeployqt +message=$(${QT_DIR}macdeployqt $INSTALL_PATH/$APPNAME \ + $ARGUMENTS 2>&1) - echo "$INSTALL_PATH is now a self contained meshlab application" -else - echo "macdeployqt failed with error code $?. Script was not completed successfully." +# if message contains "ERROR" then macdeployqt failed +if [[ $message == *"ERROR"* ]]; then + echo "macdeployqt failed." + echo "macdeployqt output:" + echo $message exit 1 -fi \ No newline at end of file +fi + +# remove everything from install path, except the appbundle +cd $INSTALL_PATH +ls | grep -xv "${APPNAME}" | xargs rm + +echo "$INSTALL_PATH is now a self contained meshlab application"