Last active
June 8, 2018 11:21
-
-
Save willis7/3aca9531f49ea37ae74a177440d105cc to your computer and use it in GitHub Desktop.
Running shellcheck using make
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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