1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

substitute: Fix "No such file or directory" message on Darwin

On Darwin, "chmod -f" does not suppress an error message if the file
doesn't exist. So just check if the file exists.
This commit is contained in:
Eelco Dolstra 2015-03-24 14:12:24 +01:00
parent d3756e162c
commit bda440a7b3

View file

@ -370,7 +370,7 @@ substitute() {
content="${content//"$pattern"/$replacement}"
done
chmod -f +w "$output" || true
if [ -e "$output" ]; then chmod +w "$output".tmp; fi
printf "%s" "$content" > "$output"
}