Normalize .sh scripts to LF endings - #105
Merged
madebygps merged 4 commits intoJun 10, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses cross-platform shell compatibility by normalizing shell scripts to LF endings (fixing the CRLF parse failures described in #92) and attempting to enforce LF going forward via Git attributes.
Changes:
- Normalized existing
*.shscripts (including CI test scripts) to LF line endings. - Added a Git attributes file intended to enforce
eol=lffor*.shfiles. - Added a self-normalization step to
ctf_setup.shto convert CRLF to LF at runtime.
Show a summary per file
| File | Description |
|---|---|
ctf_setup.sh |
Adds runtime line-ending normalization and includes LF normalization. |
.github/skills/ctf-testing/test_ctf_challenges.sh |
LF normalization (no intended logic change). |
.github/skills/ctf-testing/deploy_and_test.sh |
LF normalization (no intended logic change). |
.gitattribute |
Adds Git attributes rule intended to enforce LF for *.sh files (but filename is currently incorrect). |
Copilot's findings
- Files reviewed: 2/4 changed files
- Comments generated: 2
Comment on lines
+1
to
+2
| # Shell Scripts LF enforcement | ||
| *.sh text eol=lf No newline at end of file |
Comment on lines
6
to
10
| set -euo pipefail | ||
|
|
||
| perl -pi -e 's/\r\n/\n/g' "$0" | ||
|
|
||
| exec > >(tee /var/log/ctf_setup.log) 2>&1 |
Comment on lines
6
to
10
| set -euo pipefail | ||
|
|
||
| perl -pi -e 's/\r\n/\n/g' "$0" | ||
|
|
||
| exec > >(tee /var/log/ctf_setup.log) 2>&1 |
madebygps
self-requested a review
June 8, 2026 20:30
madebygps
requested changes
Jun 8, 2026
Collaborator
|
I resolved this |
Contributor
Author
|
What was the fix to the error @madebygps |
Collaborator
|
@Human-Gechi for future contributions, please let us know if something is blocking you, we are always happy to answer questions and guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Normalize ctf_setup.sh to follow LF endings
This PR normalizes ctf_setup.sh to LF line endings and adds repo-level .gitattributes enforcement so shell scripts stay compatible across Windows, macOS, and Linux. The setup script also uses
perl -pi -e 's/\r\n/\n/g' "$0"turning CRLF\r\nto\nLF to self-normalize its own line endings during execution.What changed
'**/*.sh'so the repository stores the corrected line endings going forward.Closes #92