From 84c551ee31ca6e7e48310c21e755f5490a6ce3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Sun, 27 Jun 2021 13:26:54 +0200 Subject: [PATCH] Look in /Application and Utilities first First /Applications, then /Applications/Utilities, and then Spotlight. Maybe we should be prepared that DEPnotify should be installed in Utilities, so `customDestination="/Applications/Utilities/"`could ba a thing. --- Installomator.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Installomator.sh b/Installomator.sh index 4f77c53..8790043 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -337,15 +337,16 @@ getAppVersion() { fi fi - # get all apps matching name - applist=$(mdfind "kind:application $appName" -0 ) - if [[ $applist = "" ]]; then - printlog "Spotlight not returning any app, trying manually in /Applications." - if [[ -d "/Applications/$appName" ]]; then - applist="/Applications/$appName" - fi + # get app from /Applications or find using Spotify + if [[ -d "/Applications/$appName" ]]; then + applist="/Applications/$appName" + elif [[ -d "/Applications/Utilities/$appName" ]]; then + applist="/Applications/Utilities/$appName" + else + applist=$(mdfind "kind:application $appName" -0 ) fi - + printlog "App(s) found: ${applist}" + appPathArray=( ${(0)applist} ) if [[ ${#appPathArray} -gt 0 ]]; then