From a770938905dfe87c1395f8246940c00c7d0cf52a Mon Sep 17 00:00:00 2001 From: Christian Zimpelmann Date: Sun, 9 Apr 2023 07:31:17 +0200 Subject: [PATCH] adjust `update_envs` to make sure that created files have LF line endings (#455) --- .envs/update_envs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.envs/update_envs.py b/.envs/update_envs.py index 8422b58e3..efa8adf13 100644 --- a/.envs/update_envs.py +++ b/.envs/update_envs.py @@ -41,7 +41,11 @@ def main(): # write environments for name, env in zip(["linux", "others"], [test_env_linux, test_env_others]): - Path(f".envs/testenv-{name}.yml").write_text("\n".join(env) + "\n") + # Specify newline to avoid wrong line endings on Windows. + # See: https://stackoverflow.com/a/69869641 + Path(f".envs/testenv-{name}.yml").write_text( + "\n".join(env) + "\n", newline="\n" + ) if __name__ == "__main__":