Skip to content

Commit 97cc445

Browse files
author
Developer
committed
Enhanced mac_app_sign script to handle potential bundle versioning errors.
1 parent ad710b4 commit 97cc445

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

package/mac_app_sign_and_package.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,20 @@ if [[ -e ${DISTRIBUTION}${APP_BUNDLE} ]]
250250
then
251251
if [[ -e ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info.plist ]]
252252
then
253-
echo "Attempting to update bundle's Info.plist to version: \"${VERSION}\""
254-
sed s_\<string\>0.0.0\<\/string\>_\<string\>${VERSION}\<\/string\>_ ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info.plist > ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info2.plist
255-
rm ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info.plist
256-
mv ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info2.plist ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info.plist
253+
if sed -i.bak s_\<string\>0.0.0\<\/string\>_\<string\>${VERSION}\<\/string\>_ ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info.plist > ${DISTRIBUTION}${APP_BUNDLE}/Contents/Info2.plist
254+
then
255+
echo "Set bundle's Info.plist to version: \"${VERSION}\""
256+
else
257+
echo "[Error] Could not set bundle's version in Info.plist."
258+
exit 1
259+
fi
260+
else
261+
echo "[Error] Application bundle does not include an Info.plist file."
262+
exit 1
257263
fi
264+
else
265+
echo "[Error] Application bundle not found: ${DISTRIBUTION}${APP_BUNDLE}"
266+
exit 1
258267
fi
259268

260269
echo

0 commit comments

Comments
 (0)