aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-04-27 01:46:43 +1200
committerTom Ryder <tom@sanctum.geek.nz>2014-04-27 01:46:43 +1200
commitb2a6e3e24989e10155aeb989933d400d2e12f993 (patch)
tree812db8dce3687ef48a94f623d6fc23429b605548 /Makefile
parentMention install-task (diff)
downloaddotfiles-b2a6e3e24989e10155aeb989933d400d2e12f993.tar.gz
dotfiles-b2a6e3e24989e10155aeb989933d400d2e12f993.zip
Add test-bash, test-sh, and test targets
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index f3dd884a..1c691bbc 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ install : install-bash \
install-terminfo \
install-vim
-install-bash :
+install-bash : test-bash
mkdir -p $(HOME)/.config
rm -f $(HOME)/.bashrc $(HOME)/.bash_profile \
$(HOME)/.bash_logout $(HOME)/.config/bash_completion
@@ -78,7 +78,7 @@ install-readline :
rm -f $(HOME)/.inputrc
ln -s $(PWD)/readline/inputrc $(HOME)/.inputrc
-install-sh :
+install-sh : test-sh
rm -f $(HOME)/.profile
rm -fr $(HOME)/.profile.d
ln -s $(PWD)/sh/profile $(HOME)/.profile
@@ -123,3 +123,21 @@ install-x : install-i3
ln -s $(PWD)/X/xsession $(HOME)/.xsession
ln -s $(PWD)/X/xsessionrc $(HOME)/.xsessionrc
+test : test-sh test-bash
+
+test-sh :
+ @for sh in $(PWD)/sh/* $(PWD)/sh/profile.d/* ; do \
+ if [ -f "$$sh" ] && ! sh -n "$$sh" ; then \
+ exit 1 ; \
+ fi \
+ done
+ @echo "All sh(1) scripts parsed successfully."
+
+test-bash :
+ @for bash in $(PWD)/bash/* $(PWD)/bash/bashrc.d/* ; do \
+ if [ -f "$$bash" ] && ! bash -n "$$bash" ; then \
+ exit 1 ; \
+ fi \
+ done
+ @echo "All bash(1) scripts parsed successfully."
+