From 19f1c4f3cb4b9fac712de3165616efd90f39ace7 Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Wed, 11 Mar 2020 16:19:00 +0100 Subject: [PATCH] added zip support --- buildCaseStatement.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/buildCaseStatement.sh b/buildCaseStatement.sh index d2a86ae..51409fb 100755 --- a/buildCaseStatement.sh +++ b/buildCaseStatement.sh @@ -44,6 +44,7 @@ elif [ "$archiveExt" = "dmg" ]; then # check if app exists appPath=$(find "$dmgmount" -name "*.app" -maxdepth 1 -print ) + appName=${appPath##*/} # verify with spctl echo "Verifying: $appPath" @@ -53,6 +54,20 @@ elif [ "$archiveExt" = "dmg" ]; then fi hdiutil detach "$dmgmount" +elif [ "$archiveExt" = "zip" ]; then + # unzip the archive + unzip -qq "$archiveName" + + # check if app exists + appPath=$(find "$tmpDir" -name "*.app" -maxdepth 2 -print ) + appName=${appPath##*/} + # verify with spctl + echo "Verifying: $appPath" + if ! teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then + echo "Error verifying $appPath" + exit 4 + fi + fi echo @@ -60,7 +75,10 @@ echo " $identifier)" echo " name=\"$name\"" echo " type=\"$archiveExt\"" echo " downloadURL=\"$downloadURL\"" -echo " teamID=\"$teamID\"" +echo " expectedTeamID=\"$teamID\"" +if [ -n "$appName" ] && [ "$appName" != "${name}.app" ]; then +echo " appName=\"$appName\"" +fi echo " ;;" echo