Skip to content

Commit 482ffd4

Browse files
author
Jakub Marciniak
committed
secpnd version
1 parent ff5d090 commit 482ffd4

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/check-line-endings.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff 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."

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.2
1+
0.8.3

0 commit comments

Comments
 (0)