Merge branch 'app-searching-changes-in-getAppVersion' into dev-v9.0.1

This commit is contained in:
Armin Briegel
2022-02-18 16:56:22 +01:00

View File

@@ -222,19 +222,34 @@ getAppVersion() {
fi
fi
# get app in /Applications, or /Applications/Utilities, or find using Spotlight
if [[ -d "/Applications/$appName" ]]; then
# get app in targetDir, /Applications, or /Applications/Utilities
if [[ -d "$targetDir/$appName" ]]; then
applist="$targetDir/$appName"
elif [[ -d "/Applications/$appName" ]]; then
applist="/Applications/$appName"
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
# targetDir="/Applications"
# fi
elif [[ -d "/Applications/Utilities/$appName" ]]; then
applist="/Applications/Utilities/$appName"
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
# targetDir="/Applications/Utilities"
# fi
else
applist=$(mdfind "kind:application $appName" -0 )
# applist=$(mdfind "kind:application $appName" -0 )
printlog "name: $name, appName: $appName"
applist=$(mdfind "kind:application AND name:$name" -0 )
# printlog "App(s) found: ${applist}" DEBUG
# applist=$(mdfind "kind:application AND name:$appName" -0 )
fi
if [[ -z applist ]]; then
printlog "No previous app found" INFO
else
printlog "App(s) found: ${applist}" INFO
fi
# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then
# printlog "targetDir for installation: $targetDir" INFO
# fi
appPathArray=( ${(0)applist} )