1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-09 16:45:48 +00:00

feat(uninstall): enhance brew UX and auto-cleanup dependencies

- Auto-run 'brew autoremove' after uninstalling casks
- Fix spinner interference during brew operations
- Add safety check for cask token detection
This commit is contained in:
Tw93
2026-01-15 14:31:36 +08:00
parent dbf036fdaa
commit 7b14a3abd8
2 changed files with 14 additions and 3 deletions

View File

@@ -92,6 +92,9 @@ _detect_cask_via_caskroom_search() {
done < <(find "$room" -maxdepth 3 -name "$app_bundle_name" 2>/dev/null)
done
# Need at least one token
((${#tokens[@]} > 0)) || return 1
# Deduplicate and check count
local -a uniq
IFS=$'\n' read -r -d '' -a uniq < <(printf '%s\n' "${tokens[@]}" | sort -u && printf '\0') || true