Skip to content

Commit

Permalink
feat: support -*- shell script -*- script header
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Feb 27, 2024
1 parent 65342fa commit f23778e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions.sh
Expand Up @@ -142,7 +142,7 @@ has_shebang () {
fi

# Emacs mode detection
if grep --quiet -E '^\s*#\s+-\*-\s+(sh|ash|bash|dash|ksh|bats)\s+-\*-\s*' "${file}"; then
if grep --quiet -E '^\s*#.*\s+-\*-\s+(sh|ash|bash|dash|ksh|bats|shell-script)\s+-\*-\s*' "${file}"; then
return 0
fi

Expand Down
1 change: 1 addition & 0 deletions test/has_shebang.bats
Expand Up @@ -250,6 +250,7 @@ setup () {
' # -*- sh -*-'
' # -*- sh -*-'
' # -*- sh -*- ... ...'
'# systemd-sysext(8) completion -*- shell-script -*-'
)
local emacs_incorrect=(
' -*- sh -*-'
Expand Down

0 comments on commit f23778e

Please sign in to comment.