Add .gitattributes to enforce LF line endings for shell scripts
This fixes issues when running scripts in WSL where CRLF line endings cause 'No such file or directory' errors. Also add a fix_line_endings.sh script for users who already have the wrong line endings.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# Ensure shell scripts always use LF line endings
|
||||
*.sh text eol=lf
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Fix line endings for coverage scripts
|
||||
|
||||
echo "Fixing line endings for coverage scripts..."
|
||||
|
||||
# Convert CRLF to LF
|
||||
dos2unix scripts/measure_coverage.sh 2>/dev/null || sed -i 's/\r$//' scripts/measure_coverage.sh
|
||||
dos2unix scripts/generate_coverage_html.sh 2>/dev/null || sed -i 's/\r$//' scripts/generate_coverage_html.sh
|
||||
|
||||
# Ensure execute permissions
|
||||
chmod +x scripts/measure_coverage.sh
|
||||
chmod +x scripts/generate_coverage_html.sh
|
||||
|
||||
echo "Done! Line endings fixed and execute permissions set."
|
||||
echo ""
|
||||
echo "You can now run:"
|
||||
echo " make coverage-report"
|
||||
echo " make coverage-html"
|
||||
Reference in New Issue
Block a user