From ce8905eff5ca7f85dae58db6832c1409109e7a25 Mon Sep 17 00:00:00 2001 From: Konano Date: Wed, 30 Sep 2026 13:44:34 +0800 Subject: [PATCH] feat: report skipped file updates --- update.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index 656fa3e..1a32edc 100755 --- a/update.sh +++ b/update.sh @@ -8,7 +8,13 @@ update_file() { local A="$1" local B="$2" - if [ -f "$A" ] && [ -f "$B" ] && [ "$(cat "$A")" != "$(cat "$B")" ]; then + if [ ! -f "$B" ]; then + echo "File $B does not exist, skipping update." + printf 'Run: mkdir -p %q && cp %q %q\n' "$(dirname "$B")" "$A" "$B" + return + fi + + if [ -f "$A" ] && [ "$(cat "$A")" != "$(cat "$B")" ]; then cp "$A" "$B" echo "File $B has been updated." fi