diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-04-19 15:42:34 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-04-19 15:54:46 -0400 |
commit | a41df19413f8e1b45b25fc4bd6a4434ad38be057 (patch) | |
tree | e0ab96b916a5796bb41e9318b8d22e75596ff6f5 /flags.sh | |
parent | 13cd21d9f1b62456f84aa995a9b4e5b203bf657c (diff) | |
download | bfs-a41df19413f8e1b45b25fc4bd6a4434ad38be057.tar.xz |
Makefile: Move .flags to build/FLAGS
Diffstat (limited to 'flags.sh')
-rwxr-xr-x | flags.sh | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,11 +1,14 @@ #!/usr/bin/env bash -set -e +set -eu -echo "$@" >.newflags +OUT="$1" +shift -if [ -e .flags ] && cmp -s .flags .newflags; then - rm .newflags +echo "$@" >"$OUT.tmp" + +if [ -e "$OUT" ] && cmp -s "$OUT" "$OUT.tmp"; then + rm "$OUT.tmp" else - mv .newflags .flags + mv "$OUT.tmp" "$OUT" fi |