added Whatsapp, now automatically derives appName

This commit is contained in:
Armin Briegel
2020-03-10 10:13:29 +01:00
parent 169b870372
commit 4c0876fcb1

View File

@@ -23,8 +23,14 @@ fi
# - downloadURL: # - downloadURL:
# URL to download the dmg # URL to download the dmg
# #
# - appName: # - dmgName: (optional)
# The name of the downloaded dmg
# When not given the dmgName is derived from the last part of the downloadURL
#
# - appName: (optional)
# file name of the app bundle in the dmg to verify and copy (include .app) # file name of the app bundle in the dmg to verify and copy (include .app)
# When not given, the App name is derived from the dmgName by removing the extension
# and adding .app
# #
# - expectedTeamID: # - expectedTeamID:
# 10-digit developer team ID # 10-digit developer team ID
@@ -66,20 +72,21 @@ case $identifier in
;; ;;
Spotify) Spotify)
downloadURL="https://download.scdn.co/Spotify.dmg" downloadURL="https://download.scdn.co/Spotify.dmg"
appName="Spotify.app"
expectedTeamID="2FNC3A47ZF" expectedTeamID="2FNC3A47ZF"
;; ;;
BBEdit) BBEdit)
downloadURL=$(curl -s https://versioncheck.barebones.com/BBEdit.xml | grep dmg | sort | tail -n1 | cut -d">" -f2 | cut -d"<" -f1) downloadURL=$(curl -s https://versioncheck.barebones.com/BBEdit.xml | grep dmg | sort | tail -n1 | cut -d">" -f2 | cut -d"<" -f1)
appName="BBEdit.app"
expectedTeamID="W52GZAXT98" expectedTeamID="W52GZAXT98"
;; ;;
Firefox) Firefox)
downloadURL="https://download.mozilla.org/?product=firefox-latest&amp;os=osx&amp;lang=en-US" downloadURL="https://download.mozilla.org/?product=firefox-latest&amp;os=osx&amp;lang=en-US"
dmgName="Firefox.dmg" dmgName="Firefox.dmg"
appName="Firefox.app"
expectedTeamID="43AQ936H96" expectedTeamID="43AQ936H96"
;; ;;
WhatsApp)
downloadURL="https://web.whatsapp.com/desktop/mac/files/WhatsApp.dmg"
expectedTeamID="57T9237FN3"
;;
brokenDownloadURL) brokenDownloadURL)
downloadURL="https://broken.com/broken.dmg" downloadURL="https://broken.com/broken.dmg"
appName="Google Chrome.app" appName="Google Chrome.app"
@@ -106,6 +113,10 @@ if [ -z "$dmgName" ]; then
dmgName="${downloadURL##*/}" dmgName="${downloadURL##*/}"
fi fi
if [ -z "$appName" ]; then
appName="${dmgName%%.*}.app"
fi
cleanupAndExit() { # $1 = exit code cleanupAndExit() { # $1 = exit code
if [ "$DEBUG" -eq 0 ]; then if [ "$DEBUG" -eq 0 ]; then
# remove the temporary working directory when done # remove the temporary working directory when done