From b30d4da703f496dd6e8d6dd1a8f896822f7e6a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 9 Feb 2022 14:04:23 +0100 Subject: [PATCH] Update functions.sh --- fragments/functions.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index 25b53a5..419275d 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -225,25 +225,29 @@ getAppVersion() { applist="$targetDir/$appName" elif [[ -d "/Applications/$appName" ]]; then applist="/Applications/$appName" - if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then - targetDir="/Applications" - fi +# 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 +# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then +# targetDir="/Applications/Utilities" +# fi + else # 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" DEBUG else printlog "App(s) found: ${applist}" DEBUG fi - if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then - printlog "targetDir for installation: $targetDir" INFO - fi +# if [[ $type =~ '^(dmg|zip|tbz|app.*)$' ]]; then +# printlog "targetDir for installation: $targetDir" INFO +# fi appPathArray=( ${(0)applist} )