Skip to content

Commit

Permalink
🐛 Fix Windows line endings for shell scripts after generation (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Apr 18, 2020
1 parent 001dbda commit af4e0cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from pathlib import Path


path: Path
for path in Path(".").glob("**/*.sh"):
data = path.read_bytes()
lf_data = data.replace(b"\r\n", b"\n")
path.write_bytes(lf_data)

2 comments on commit af4e0cf

@s-bose
Copy link

@s-bose s-bose commented on af4e0cf Jan 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. Can you explain where or how is this being used? I can't seem to find any mention of this file anywhere else.

@tiangolo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used by Cookiecutter, just to fix some weirdnesses of Windows.

Sorry for the long delay! 🙈 I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.

Please sign in to comment.