aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdot-backup.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/dot-backup.sh b/dot-backup.sh
index e95c67f..892529c 100755
--- a/dot-backup.sh
+++ b/dot-backup.sh
@@ -251,6 +251,15 @@ _suggest_ignored() {
return 1
}
+# True if basename $1 looks like editor/temp junk (vim undo/swap, backups, etc.)
+_suggest_junk() {
+ local b="$1"
+ case "$b" in
+ *.un~|*~|*.swp|*.swo|*.tmp|.DS_Store) return 0 ;;
+ *) return 1 ;;
+ esac
+}
+
do_suggest() {
local epoch_file="${DEFAULT_OUTPUT_DIR}/lastupdate.epoch"
local last_epoch=0
@@ -272,6 +281,7 @@ do_suggest() {
[[ -e "$path" ]] || continue
base="$(basename "$path")"
emit=".config/${base}"
+ _suggest_junk "$base" && continue
_suggest_ignored "$base" && continue
_suggest_covered "$emit" && continue
mtime="$(stat -c %Y "$path" 2>/dev/null || echo 0)"
@@ -284,6 +294,7 @@ do_suggest() {
[[ "$base" == "." || "$base" == ".." ]] && continue
[[ -d "$path" || -f "$path" ]] || continue
emit="${base}"
+ _suggest_junk "$base" && continue
_suggest_ignored "$base" && continue
_suggest_covered "$emit" && continue
mtime="$(stat -c %Y "$path" 2>/dev/null || echo 0)"