Skip to content
Snippets Groups Projects
Unverified Commit c2d14538 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

lint: sh: improve shellscript detection

- Implify filename check
- Check for ! in shebang
- Check for either /bin/sh or anything ending with the word bash
parent 085250c2
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
set -e
is_scriptfile() {
echo "$1" | grep -qE '.*\.sh$' || head -n1 "$1" | grep -qE '^#.*(sh|bash)$'
echo "$1" | grep -q '\.sh$' || head -n1 "$1" | grep -qE '^#!(.*\<bash|/bin/sh)$'
}
find contrib -type f | while read -r file; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment