updated redundant exit codes, closes #561

See also: https://github.com/Installomator/Installomator/wiki/Installomator-Exit-Codes
This commit is contained in:
Armin Briegel
2022-08-12 13:47:44 +02:00
parent 4e5f069024
commit 1477457155
3 changed files with 10 additions and 10 deletions

View File

@@ -163,7 +163,7 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
| awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
if [ -z "$downloadURL" ]; then
cleanupAndExit 9 "could not retrieve download URL for $gitusername/$gitreponame" ERROR
cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR
else
echo "$downloadURL"
return 0
@@ -278,7 +278,7 @@ getAppVersion() {
printlog "Replacing App Store apps, no matter the version" WARN
appversion=0
else
cleanupAndExit 1 "App previously installed from App Store, and we respect that" ERROR
cleanupAndExit 23 "App previously installed from App Store, and we respect that" ERROR
fi
fi
else
@@ -475,7 +475,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
printlog "notifying"
displaynotification "$message" "Error updating $name!"
fi
cleanupAndExit 6 "Installed macOS is too old for this app." ERROR
cleanupAndExit 15 "Installed macOS is too old for this app." ERROR
fi
fi
@@ -534,7 +534,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
deduplicatelogs "$CLIoutput"
if [ $CLIstatus -ne 0 ] ; then
cleanupAndExit 3 "Error installing $mountname/$CLIInstaller $CLIArguments error:\n$logoutput" ERROR
cleanupAndExit 16 "Error installing $mountname/$CLIInstaller $CLIArguments error:\n$logoutput" ERROR
else
printlog "Succesfully ran $mountname/$CLIInstaller $CLIArguments" INFO
fi
@@ -732,7 +732,7 @@ installPkgInZip() {
printlog "Found pkg(s):\n$findfiles" DEBUG
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find pkg in zip $archiveName" ERROR
cleanupAndExit 21 "couldn't find pkg in zip $archiveName" ERROR
fi
# it is now safe to overwrite archiveName for installFromPKG
archiveName="${filearray[1]}"
@@ -745,7 +745,7 @@ installPkgInZip() {
findfiles=$(find "$tmpDir" -iname "$pkgName")
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName" ERROR
cleanupAndExit 21 "couldn't find pkg “$pkgName” in zip $archiveName" ERROR
fi
# it is now safe to overwrite archiveName for installFromPKG
archiveName="${filearray[1]}"
@@ -768,7 +768,7 @@ installAppInDmgInZip() {
findfiles=$(find "$tmpDir" -iname "*.dmg" -maxdepth 2 )
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find dmg in zip $archiveName" ERROR
cleanupAndExit 22 "couldn't find dmg in zip $archiveName" ERROR
fi
archiveName="$(basename ${filearray[1]})"
# it is now safe to overwrite archiveName for installFromDMG

View File

@@ -13,7 +13,7 @@ macports)
archiveName="Catalina.pkg"
;;
*)
cleanupAndExit 1 "macOS 10.14 or earlier not supported by Installomator."
cleanupAndExit 98 "macOS 10.14 or earlier not supported by Installomator."
;;
esac
downloadURL=$(downloadURLFromGit macports macports-base)

View File

@@ -18,7 +18,7 @@ fi
if [[ ${INTERRUPT_DND} = "no" ]]; then
# Check if a fullscreen app is active
if hasDisplaySleepAssertion; then
cleanupAndExit 1 "active display sleep assertion detected, aborting" ERROR
cleanupAndExit 24 "active display sleep assertion detected, aborting" ERROR
fi
fi
@@ -132,7 +132,7 @@ fi
# MARK: change directory to temporary working directory
printlog "Changing directory to $tmpDir" DEBUG
if ! cd "$tmpDir"; then
cleanupAndExit 1 "error changing directory $tmpDir" ERROR
cleanupAndExit 13 "error changing directory $tmpDir" ERROR
fi
# MARK: get installed version