Skip to content

Instantly share code, notes, and snippets.

@edupo
Created May 26, 2017 19:44
Show Gist options
  • Save edupo/3f44d4e3f5250f178c06593dcac55044 to your computer and use it in GitHub Desktop.
Save edupo/3f44d4e3f5250f178c06593dcac55044 to your computer and use it in GitHub Desktop.
Shell script test Makefile
#!/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