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}"
|
content="${content//"$pattern"/$replacement}"
|
||||||
done
|
done
|
||||||
|
|
||||||
printf "%s" "$content" > "$output".tmp
|
chmod -f +w "$output" || true
|
||||||
if [ -x "$output" ]; then chmod +x "$output".tmp; fi
|
printf "%s" "$content" > "$output"
|
||||||
mv -f "$output".tmp "$output"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue