Bug 1795796 - Port bug 1794697: Write files with "\n" line endings when esmifying. r=mkmelin

Prevents files being written with default "\r\n" line endings when run on Windows.
Ensures consistency with the rest of the tree.

Differential Revision: https://phabricator.services.mozilla.com/D159552

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Lemley 2022-10-18 21:46:29 +00:00
Родитель 21c4a789f7
Коммит 223ac3aa17
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -437,7 +437,7 @@ def try_rename_in(command_context, path, target, jsm_name, esm_name, jsm_path):
if modified:
info(f" {str(target_path)}")
info(f" {jsm_name} => {esm_name}")
with open(target_path, "w") as f:
with open(target_path, "w", newline="\n") as f:
f.write(content)
return True
@ -472,7 +472,7 @@ def try_rename_components_conf(command_context, path, jsm_name, esm_name):
info(f" {jsm_name} => {esm_name}")
content = prop_re.sub(r"'esModule':\1" + esm_name, content)
with open(target_path, "w") as f:
with open(target_path, "w", newline="\n") as f:
f.write(content)
return True