Revision 8735
Added by Aaron Marcuse-Kubitza over 11 years ago
in_place | ||
---|---|---|
13 | 13 |
|
14 | 14 |
"$@" <"$file" >"$temp" # exits on error so file not updated |
15 | 15 |
diff "$file" "$temp" >/dev/null && exit # don't update file if no change |
16 |
case "$(uname)" in Linux) chmod --reference="$file" "$temp";; esac |
|
16 | 17 |
mv "$temp" "$file" |
Also available in: Unified diff
bin/in_place: set the permissions of the new file to the original file when `chmod --reference` is available. this ensures that when a file is marked web-accessible, it stays web-accessible when you run an in_place command on it.