Skip to content

fix: handle CRLF line endings properly #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

engynear
Copy link

Found an issue with line endings when building Dockerfile on Windows. Here's what happened and how I fixed it:

The problem:

  • When I cloned the repo on Windows, Git converted line endings to CRLF automatically
  • This broke shell scripts in Docker with "bad option: -eo" error
  • Also caused TeX Live packages to fail installing because package names had \r in them

What I did:

  1. Added .gitattributes to handle line endings properly:

    • Shell scripts (.sh) will always use LF
    • Windows batch files (.bat) will use CRLF
    • Other files will convert automatically
  2. Fixed the TeX Live package installer by removing any \r characters from package names

Test results:

  • Shell scripts now run fine in Docker on Windows
  • TeX Live packages install correctly
  • Didn't break anything else

Let me know if you need any changes or have questions!

- Add .gitattributes to enforce LF for shell scripts
- Fix TeX Live package installation by removing CRLF from package names
- Ensure consistent line endings across platforms
@engynear engynear force-pushed the fix/crlf-line-endings branch from a951d30 to f1357f8 Compare March 28, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant