Merge pull request #5714 from vcunat/p/stdenv-subst
stdenv substitute: avoid using a temporary file
This commit is contained in:
commit
4b82bd683e
1 changed files with 2 additions and 3 deletions
|
@ -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 a new issue