File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,15 +15,23 @@ jobs:
1515 - name : Checkout code
1616 uses : actions/checkout@v3
1717
18- - name : Find files with CRLF line endings
18+ - name : Find shell scripts with CRLF line endings
19+ shell : bash
1920 run : |
20- echo "🔍 Checking for CRLF endings..."
21- CRLF_FILES=$(grep -Ilr $'\r' . --exclude-dir=.git --include='*.sh')
22- if [[ -n "$CRLF_FILES" ]]; then
23- echo "🚫 The following files contain CRLF (Windows-style) line endings:"
24- echo "$CRLF_FILES"
21+ echo "🔍 Checking for CRLF endings in shell scripts..."
22+
23+ # Szukamy plików .sh zawierających CRLF
24+ mapfile -t crlf_files < <(find . -type f -name "*.sh" -exec grep -Il $'\r' {} +)
25+
26+ if (( ${#crlf_files[@]} > 0 )); then
27+ echo ""
28+ echo "🚫 The following .sh files contain CRLF (Windows-style) line endings:"
29+ for file in "${crlf_files[@]}"; do
30+ echo " • $file"
31+ done
2532 echo ""
26- echo "💡 Please convert them to LF endings (e.g., using 'dos2unix') ."
33+ echo "💡 Please convert them to LF endings using 'dos2unix' or 'shellman line_endings' ."
2734 exit 1
35+ else
36+ echo "✅ All .sh files use correct LF line endings."
2837 fi
29- echo "✅ All shell scripts have correct LF endings."
Original file line number Diff line number Diff line change 1- 0.8.2
1+ 0.8.3
You can’t perform that action at this time.
0 commit comments