You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Get stale versions (everything after keep_count)
374
+
local -a stale_dirs=("${sorted_dirs[@]:$keep_count}")
384
375
385
-
if [[ "$DRY_RUN"=="true" ]];then
386
-
echo -e "${YELLOW}${ICON_DRY_RUN}${NC}${display_name} · would remove ${#stale_dirs[@]} old versions (${stale_size_human}), keeping ${keep_count} most recent"
387
-
note_activity
388
-
else
389
-
# Remove old versions
390
-
local removed_count=0
376
+
if [[ ${#stale_dirs[@]}-gt 0 ]];then
377
+
# Calculate total size of stale versions
378
+
local stale_size_kb=0 entry_size_kb
391
379
forstale_entryin"${stale_dirs[@]}";do
392
-
if should_protect_path "$stale_entry"|| is_path_whitelisted "$stale_entry";then
echo -e "${GREEN}${ICON_SUCCESS}${NC}${display_name} · removed ${removed_count} old versions, ${stale_size_human}"
386
+
if [[ "$DRY_RUN"=="true" ]];then
387
+
echo -e "${YELLOW}${ICON_DRY_RUN}${NC}${display_name} · would remove ${#stale_dirs[@]} old versions (${stale_size_human}), keeping ${keep_count} most recent"
402
388
note_activity
389
+
else
390
+
# Remove old versions
391
+
local removed_count=0
392
+
forstale_entryin"${stale_dirs[@]}";do
393
+
if should_protect_path "$stale_entry"|| is_path_whitelisted "$stale_entry";then
394
+
continue
395
+
fi
396
+
if safe_remove "$stale_entry";then
397
+
removed_count=$((removed_count +1))
398
+
fi
399
+
done
400
+
401
+
if [[ $removed_count-gt 0 ]];then
402
+
echo -e "${GREEN}${ICON_SUCCESS}${NC}${display_name} · removed ${removed_count} old versions, ${stale_size_human}"
0 commit comments