Project

General

Profile

« Previous | Next » 

Revision 8735

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.

View differences:

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