Skip to content

Instantly share code, notes, and snippets.

@willis7
Last active June 8, 2018 11:21
Show Gist options
  • Save willis7/3aca9531f49ea37ae74a177440d105cc to your computer and use it in GitHub Desktop.
Save willis7/3aca9531f49ea37ae74a177440d105cc to your computer and use it in GitHub Desktop.
Running shellcheck using make
#!/usr/bin/make
# exclude switches are useful for git and vim users. Other may apply here.
test: shellcheck.check
grep -rIl '^#![[:blank:]]*/bin/\(bash\|sh\|zsh\)' \
--exclude-dir=.git --exclude=*.sw? \
| xargs shellcheck
# .check targets just tests for a command to be available on your PATH.
.PHONY: %.check
%.check:
@which $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment