From 1b8f447f18ec4fa8e28e65d955f84da4f21d191d Mon Sep 17 00:00:00 2001 From: Tw93 Date: Tue, 11 Nov 2025 10:04:17 +0800 Subject: [PATCH] Fix output issue --- bin/clean.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/clean.sh b/bin/clean.sh index 4d2280b..7bf1290 100755 --- a/bin/clean.sh +++ b/bin/clean.sh @@ -751,8 +751,11 @@ perform_cleanup() { if [[ -t 1 ]]; then stop_inline_spinner; fi # Show summary of what was cleaned - local removed_count=$(echo "$brew_output" | grep -c "Removing:" || echo "0") - local freed_space=$(echo "$brew_output" | grep -o "[0-9.]*[KMGT]B freed" | tail -1 || echo "") + local removed_count + removed_count=$(printf '%s\n' "$brew_output" | grep -c "Removing:" 2>/dev/null || true) + removed_count="${removed_count:-0}" + local freed_space + freed_space=$(printf '%s\n' "$brew_output" | grep -o "[0-9.]*[KMGT]B freed" 2>/dev/null | tail -1 || true) if [[ $removed_count -gt 0 ]] || [[ -n "$freed_space" ]]; then if [[ -n "$freed_space" ]]; then