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

fix: show spinner during cleanup phase

Add progress indicator when deleting files to prevent the terminal
from appearing frozen during long-running cleanup operations.

Closes #358
This commit is contained in:
Tw93
2026-01-24 08:31:04 +08:00
parent c0596f51e3
commit fbff0ec3bd

View File

@@ -522,6 +522,10 @@ safe_clean() {
fi
# Read results back in original order.
# Start spinner for cleaning phase
if [[ "$DRY_RUN" != "true" && ${#existing_paths[@]} -gt 0 && -t 1 ]]; then
MOLE_SPINNER_PREFIX=" " start_inline_spinner "Cleaning..."
fi
idx=0
if [[ ${#existing_paths[@]} -gt 0 ]]; then
for path in "${existing_paths[@]}"; do
@@ -558,6 +562,10 @@ safe_clean() {
fi
else
# Start spinner for cleaning phase (small batch)
if [[ "$DRY_RUN" != "true" && ${#existing_paths[@]} -gt 0 && -t 1 ]]; then
MOLE_SPINNER_PREFIX=" " start_inline_spinner "Cleaning..."
fi
local idx=0
if [[ ${#existing_paths[@]} -gt 0 ]]; then
for path in "${existing_paths[@]}"; do