Skip to content

Commit

Permalink
handle macdeployqt error, since it returns 0 even if it fails...
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Nov 15, 2023
1 parent 30bd2e8 commit c5b5b70
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions scripts/macOS/internal/2a_appbundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

echo "$INSTALL_PATH is now a self contained meshlab application"
else
echo "macdeployqt failed with error code $?. Script was not completed successfully."
# save in message the output of macdeployqt
message=$(${QT_DIR}macdeployqt $INSTALL_PATH/$APPNAME \
$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
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"

0 comments on commit c5b5b70

Please sign in to comment.