Skip to content

Commit

Permalink
Fix for line terminators on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jan 16, 2024
1 parent 4ad0a4a commit ac70f1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/version-patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ def replace_version(filename, new_text):
print(f"WARNING: failed to update version in {filename}")
else:
with open(filename, 'w') as file:
# Ensure the content has proper line terminators on windows:
new_content = new_content.replace('\n', os.linesep)
file.write(new_content)

sys.exit(0) # Bypass for test

# If a flag exists, skip any updating, just print a message and exit
if "ALR_VERSION_DONT_PATCH" in os.environ:
print("Note: skipping version update")
Expand Down

0 comments on commit ac70f1c

Please sign in to comment.