From ca30f3cdbe5c5b994491821ae0b3f31ea4131a8c Mon Sep 17 00:00:00 2001 From: Armin Briegel <1933192+scriptingosx@users.noreply.github.com> Date: Thu, 30 Apr 2020 12:32:52 +0200 Subject: [PATCH] added `pkgInZip` functionality --- Installomator.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Installomator.sh b/Installomator.sh index 538b876..b5007c7 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -43,7 +43,7 @@ BLOCKING_PROCESS_ACTION=prompt_user # - pkg # - zip # - pkgInDmg -# - pkgInZip (not yet implemented) +# - pkgInZip (not yet tested) # # - downloadURL: (required) # URL to download the dmg. @@ -760,6 +760,23 @@ installPkgInDmg() { installFromPKG } +installPkgInZip() { + # unzip the archive + echo "Unzipping $archiveName" + tar -xf "$archiveName" + + # locate pkg in zip + if [[ -z $pkgName ]]; then + pkgName="$name.pkg" + fi + + # it is now safe to overwrite archiveName for installFromPKG + archiveName="$tmpDir/$pkgName" + + # installFromPkgs + installFromPKG +} + runUpdateTool() { if [[ -x $updateTool ]]; then echo "running $updateTool $updateToolArguments" @@ -897,6 +914,9 @@ case $type in pkgInDmg) installPkgInDmg ;; + pkgInZip) + installPkgInZip + ;; *) echo "Cannot handle type $type" cleanupAndExit 99