From 3d7f77a26da0755474d756cdf296e00c203b5469 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 15 Nov 2023 17:17:59 +0100 Subject: [PATCH] handling macdeployqt error --- scripts/macOS/2_deploy.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/scripts/macOS/2_deploy.sh b/scripts/macOS/2_deploy.sh index 1d91e84..891c6df 100644 --- a/scripts/macOS/2_deploy.sh +++ b/scripts/macOS/2_deploy.sh @@ -32,17 +32,24 @@ do ARGUMENTS="${ARGUMENTS} -executable=${plugin}" done -if ${QT_DIR}macdeployqt $INSTALL_PATH/dummybin.app \ +# save in message the output of macdeployqt +message=$(${QT_DIR}macdeployqt $INSTALL_PATH/dummybin.app \ -executable=$MODULE_NAME \ - $ARGUMENTS; \ -then - rsync -a $INSTALL_PATH/dummybin.app/Contents/Frameworks/ $INSTALL_PATH/Frameworks/ - rsync -a $INSTALL_PATH/dummybin.app/Contents/PlugIns/ $INSTALL_PATH/PlugIns/ - mv $INSTALL_PATH/dummybin.app/Contents/pmeshlab* $INSTALL_PATH/ - rm -rf $INSTALL_PATH/dummybin.app -else - echo "macdeployqt failed with error code $?. Script was not completed successfully." + $ARGUMENTS 2>&1) + +# if message contains "ERROR" then macdeployqt failed +if [[ $message == *"ERROR"* ]]; then + echo "macdeployqt failed." + echo "macdeployqt output:" + echo $message exit 1 fi +echo "macdeployqt completed successfully." +rsync -a $INSTALL_PATH/dummybin.app/Contents/Frameworks/ $INSTALL_PATH/Frameworks/ +rsync -a $INSTALL_PATH/dummybin.app/Contents/PlugIns/ $INSTALL_PATH/PlugIns/ +mv $INSTALL_PATH/dummybin.app/Contents/pmeshlab* $INSTALL_PATH/ +rm -rf $INSTALL_PATH/dummybin.app + +