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}"
|
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…
x
Reference in New Issue
Block a user