summaryrefslogtreecommitdiff
path: root/fish
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-28 11:04:27 +0300
committerPaul Buetow <paul@buetow.org>2026-05-28 11:04:27 +0300
commitb4988c18d9742ec85824ba5d2e5bc2c280aa8604 (patch)
treed7f295797552cc90b0bc4f2bc23c8adf594ae164 /fish
parent183807d8a0aa9988fca69f7d0a84f67840b20286 (diff)
tmpclean: remove dry-run mode, always perform real run
Diffstat (limited to 'fish')
-rw-r--r--fish/conf.d/tmputils.fish17
1 files changed, 3 insertions, 14 deletions
diff --git a/fish/conf.d/tmputils.fish b/fish/conf.d/tmputils.fish
index 79ce47a..80686f7 100644
--- a/fish/conf.d/tmputils.fish
+++ b/fish/conf.d/tmputils.fish
@@ -92,20 +92,13 @@ function __tmpclean_stat_mtime --argument file
end
function tmpclean
- set -l dry_run
- if set -q argv[1]; and test "$argv[1]" = "--dry-run"
- set dry_run 1
- end
-
if not test -d "$TMPUTILS_DIR"
echo "tmpclean: TMPUTILS_DIR ($TMPUTILS_DIR) does not exist"
return 1
end
set -l old_dir "$TMPUTILS_DIR/OLD"
- if not set -q dry_run
- mkdir -p $old_dir
- end
+ mkdir -p $old_dir
set -l datestamp (date +%Y%m%d)
set -l threshold 31
@@ -143,12 +136,8 @@ function tmpclean
if test -n "$age_days"; and test "$age_days" -ge $threshold
set -l basename (basename "$folder")
set -l dest "$old_dir/$basename.$datestamp"
- if set -q dry_run
- echo "[DRY RUN] Would move $folder -> $dest (stale $age_days days)"
- else
- echo "Moving $folder -> $dest (stale $age_days days)"
- mv "$folder" "$dest"
- end
+ echo "Moving $folder -> $dest (stale $age_days days)"
+ mv "$folder" "$dest"
end
end
end