1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-12 14:01:17 +00:00

refactor(uninstall): enhance login item removal and brew UI

- Escape quotes/backslashes in app names for AppleScript safety
- Silence osascript stdout to prevent output noise
- Capture brew uninstall output to avoid spinner corruption
- Log brew errors to debug_log for troubleshooting
This commit is contained in:
Tw93
2026-01-15 15:13:51 +08:00
parent 9a9e6c780f
commit 30547c9c4c
2 changed files with 11 additions and 4 deletions

View File

@@ -175,9 +175,12 @@ brew_uninstall_cask() {
# Run uninstall with timeout (suppress hints/auto-update)
local uninstall_ok=false
if HOMEBREW_NO_ENV_HINTS=1 HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 \
run_with_timeout 120 brew uninstall --cask "$cask_name" 2>&1; then
local output
if output=$(HOMEBREW_NO_ENV_HINTS=1 HOMEBREW_NO_AUTO_UPDATE=1 NONINTERACTIVE=1 \
run_with_timeout 120 brew uninstall --cask "$cask_name" 2>&1); then
uninstall_ok=true
else
debug_log "brew uninstall output: $output"
fi
# Verify removal