feat: report skipped file updates
This commit is contained in:
parent
4bd93ee65e
commit
ce8905eff5
@ -8,7 +8,13 @@ update_file() {
|
|||||||
local A="$1"
|
local A="$1"
|
||||||
local B="$2"
|
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"
|
cp "$A" "$B"
|
||||||
echo "File $B has been updated."
|
echo "File $B has been updated."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user