mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 20:34:52 +03:00
Merge pull request #5714 from vcunat/p/stdenv-subst
stdenv substitute: avoid using a temporary file
This commit is contained in:
commit
4b82bd683e
@ -370,9 +370,8 @@ substitute() {
|
||||
content="${content//"$pattern"/$replacement}"
|
||||
done
|
||||
|
||||
printf "%s" "$content" > "$output".tmp
|
||||
if [ -x "$output" ]; then chmod +x "$output".tmp; fi
|
||||
mv -f "$output".tmp "$output"
|
||||
chmod -f +w "$output" || true
|
||||
printf "%s" "$content" > "$output"
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user