Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=crlf
46 changes: 46 additions & 0 deletions .github/workflows/check-line-endings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check Shell Script Line Endings

on:
pull_request:
push:

jobs:
check_crlf_in_sh:
name: Check for CRLF in .sh files
runs-on: ubuntu-latest
steps:
- name: Checkout code (with original line endings)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create .gitattributes to enforce LF
run: |
echo "*.sh text eol=lf" > .gitattributes

- name: Check for CRLF in .sh files
shell: bash
run: |
echo "🔍 Scanning all *.sh files for CRLF endings..."

mapfile -t all_sh_files < <(find . -type f -name "*.sh")

bad_files=()

for file in "${all_sh_files[@]}"; do
if grep -q $'\r' "$file"; then
bad_files+=("$file")
fi
done

if (( ${#bad_files[@]} > 0 )); then
echo "🚫 Found ${#bad_files[@]} shell script(s) with CRLF endings:"
for f in "${bad_files[@]}"; do
echo " • $f"
done
echo ""
echo "💡 Convert them using: dos2unix <file> or shellman line_endings --file <file> --to lf"
exit 1
else
echo "✅ All .sh files use proper LF endings."
fi
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.2
0.8.3
4 changes: 2 additions & 2 deletions commands/checksum_files.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
#
# Generate or verify checksums for many files.
# Default algo: sha256. Other supported: md5, sha1.
# Default algo: sha256. Other supported: md5, sha1.

source ./lib/utils.sh

show_help() {
echo "Usage:"
echo "Usage: "
echo " shellman checksum_files [options]"
echo ""
echo "Description:"
Expand Down
2 changes: 1 addition & 1 deletion commands/clean_files.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
# Remove unwanted / temporary files from a tree.
# Supports dry‑run preview and age filter.
# Supports dry‑run preview and age filter.

source ./lib/utils.sh

Expand Down