summaryrefslogtreecommitdiff
path: root/tools/maybe-mv
diff options
context:
space:
mode:
Diffstat (limited to 'tools/maybe-mv')
-rwxr-xr-xtools/maybe-mv4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/maybe-mv b/tools/maybe-mv
index 725b86b..996052f 100755
--- a/tools/maybe-mv
+++ b/tools/maybe-mv
@@ -1,8 +1,10 @@
#!/bin/bash -eu
# Replace one file with another, but maybe don't update the timestamp
-if cmp -s "$1" "$2"
+if cmp "$1" "$2"
then
+ echo rm "$1"
rm "$1"
else
+ echo mv "$1" "$2"
mv "$1" "$2"
fi