Skip to content

Commit 4ca595f

Browse files
authored
Apply suggestions from code review
1 parent 0afa994 commit 4ca595f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

install_scripts.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ sed_update_if_changed() {
5555
}
5656

5757
if ! diff -q "$file" "$tmp_file" > /dev/null; then
58-
mv "$tmp_file" "$file"
58+
# Use cat to retain existing permissions, set umask to world readable in case the target file does not yet exist.
59+
(umask 022 && cat "$tmp_file" > "$file")
5960
else
6061
rm -f "$tmp_file"
6162
fi

0 commit comments

Comments
 (0)