From 127e589291915c5afa8047d755880d6eabc8e550 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Tue, 20 Jan 2026 10:26:13 +0800 Subject: [PATCH] Fix test error case --- lib/uninstall/batch.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/uninstall/batch.sh b/lib/uninstall/batch.sh index 5e35b63..b808367 100755 --- a/lib/uninstall/batch.sh +++ b/lib/uninstall/batch.sh @@ -202,7 +202,6 @@ batch_uninstall_applications() { running_apps+=("$app_name") fi - # Check if it's a Homebrew cask (only if app is symlinked from Caskroom) local cask_name="" is_brew_cask="false" local resolved_path=$(readlink "$app_path" 2> /dev/null || echo "") if [[ "$resolved_path" == */Caskroom/* ]]; then @@ -210,6 +209,13 @@ batch_uninstall_applications() { local tmp="${resolved_path#*/Caskroom/}" cask_name="${tmp%%/*}" [[ -n "$cask_name" ]] && is_brew_cask="true" + elif command -v get_brew_cask_name > /dev/null 2>&1; then + local detected_cask + detected_cask=$(get_brew_cask_name "$app_path" 2> /dev/null || true) + if [[ -n "$detected_cask" ]]; then + cask_name="$detected_cask" + is_brew_cask="true" + fi fi # Check if sudo is needed