1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 16:49:41 +00:00

feat(uninstall): add progress spinner for brew autoremove

- Show 'Checking brew dependencies...' spinner while running brew autoremove
- Prevents user confusion when brew cleanup takes time after uninstall
- Improves UX by providing visual feedback during dependency cleanup
This commit is contained in:
Tw93
2026-01-16 10:26:46 +08:00
parent d29a0f828b
commit 60ee0e1f9c

View File

@@ -572,10 +572,20 @@ batch_uninstall_applications() {
# Auto-run brew autoremove if Homebrew casks were uninstalled
if [[ $brew_apps_removed -gt 0 ]]; then
# Show spinner while checking for orphaned dependencies
if [[ -t 1 ]]; then
start_inline_spinner "Checking brew dependencies..."
fi
local autoremove_output removed_count
autoremove_output=$(HOMEBREW_NO_ENV_HINTS=1 brew autoremove 2> /dev/null) || true
removed_count=$(printf '%s\n' "$autoremove_output" | grep -c "^Uninstalling" || true)
removed_count=${removed_count:-0}
if [[ -t 1 ]]; then
stop_inline_spinner
fi
if [[ $removed_count -gt 0 ]]; then
echo -e "${GREEN}${ICON_SUCCESS}${NC} Cleaned $removed_count orphaned brew dependencies"
echo ""