aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdot-backup.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/dot-backup.sh b/dot-backup.sh
index 21388f0..7c77531 100755
--- a/dot-backup.sh
+++ b/dot-backup.sh
@@ -265,7 +265,7 @@ do_suggest() {
fi
local -a candidates=()
- local path emit base mtime
+ local path emit base mtime item
# Source 1: ~/.config/* (children of .config)
for path in "${HOME}/.config/"*; do
@@ -275,7 +275,7 @@ do_suggest() {
_suggest_ignored "$base" && continue
_suggest_covered "$emit" && continue
mtime="$(stat -c %Y "$path" 2>/dev/null || echo 0)"
- (( mtime > last_epoch )) && candidates+=("$emit")
+ if (( mtime > last_epoch )); then candidates+=("$emit"); fi
done
# Source 2 + 3: ~/.* (hidden dirs and files at home top level)
@@ -287,7 +287,7 @@ do_suggest() {
_suggest_ignored "$base" && continue
_suggest_covered "$emit" && continue
mtime="$(stat -c %Y "$path" 2>/dev/null || echo 0)"
- (( mtime > last_epoch )) && candidates+=("$emit")
+ if (( mtime > last_epoch )); then candidates+=("$emit"); fi
done
if [[ ${#candidates[@]} -eq 0 ]]; then
@@ -300,13 +300,13 @@ do_suggest() {
while IFS= read -r line; do sorted+=("$line"); done < <(printf '%s\n' "${candidates[@]}" | sort -u)
echo -e "${GREEN}New since last backup (${last_human}):${NC}"
- for emit in "${sorted[@]}"; do
- echo -e " ${BLUE}${emit}${NC}"
+ for item in "${sorted[@]}"; do
+ echo -e " ${BLUE}${item}${NC}"
done
echo
echo "Paste into files.list:"
- for emit in "${sorted[@]}"; do
- echo "$emit"
+ for item in "${sorted[@]}"; do
+ echo "$item"
done
}