diff --git a/components/hoxay/verify.sh b/components/hoxay/verify.sh index 451fab7a..bbed5cac 100755 --- a/components/hoxay/verify.sh +++ b/components/hoxay/verify.sh @@ -89,8 +89,14 @@ if [[ "$APPS_DIR" != "$HOME/Applications" ]]; then echo "[hoxay] launch services: skipped (apps dir $APPS_DIR is not the standard location)" else [[ -x "$LSREGISTER" ]] && "$LSREGISTER" -f "$app" >/dev/null 2>&1 || true + # After an install the Launch Services database keeps resolving the shared + # bundle id to the previously registered app for a while (both the pre- and + # the post-rename build carry the same bundle id), so the lookup needs a + # settling window before it is a verdict (observed on a real macOS host: + # the same check failed right after the update and passed two minutes + # later). ls_ok=0 - for _ in $(seq 1 15); do + for _ in $(seq 1 60); do resolved="$(osascript -l JavaScript -e \ 'ObjC.import("AppKit"); var u = $.NSWorkspace.sharedWorkspace.URLForApplicationWithBundleIdentifier("'"$BUNDLE_ID"'"); u ? ObjC.unwrap(u.path) : ""' \ 2>/dev/null || true)" @@ -101,7 +107,7 @@ else sleep 1 done [[ "$ls_ok" == "1" ]] \ - || fail "Launch Services does not resolve $BUNDLE_ID to $app after 15s" + || fail "Launch Services does not resolve $BUNDLE_ID to $app after 60s" echo "[hoxay] launch services: $app" # Informational only: whether the Spotlight index currently knows the app.