Skip to content

Commit

Permalink
feat(hooks): verifies that node is in PATH (#113)
Browse files Browse the repository at this point in the history
* feat(hooks): verifies that `node` is in PATH

* chore: better wording
  • Loading branch information
AVVS authored and bahmutov committed Nov 1, 2017
1 parent 6bf31c2 commit 46e73d1
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
5 changes: 5 additions & 0 deletions hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
exit -1
fi

if [ ! -x "$(command -v node)" ]; then
echo "Node binary not found, please ensure it has been properly installed"
exit -1
fi

./node_modules/.bin/commit-msg "$@"
6 changes: 5 additions & 1 deletion hooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ if [ ! -d "$DIRECTORY" ]; then
echo "WARNING: Cannot find node_modules folder, please run 'npm install' first"
fi

if [ -d "$DIRECTORY" ]; then
if [ ! -x "$(command -v node)" ]; then
echo "WARNING: Node binary not found, please ensure it has been properly installed"
fi

if [ -d "$DIRECTORY" ] && [ -x "$(command -v node)" ]; then
./node_modules/.bin/post-checkout "$@"
fi
5 changes: 5 additions & 0 deletions hooks/post-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
exit -1
fi

if [ ! -x "$(command -v node)" ]; then
echo "Node binary not found, please ensure it has been properly installed"
exit -1
fi

./node_modules/.bin/post-commit "$@"
5 changes: 5 additions & 0 deletions hooks/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
exit -1
fi

if [ ! -x "$(command -v node)" ]; then
echo "Node binary not found, please ensure it has been properly installed"
exit -1
fi

./node_modules/.bin/post-merge "$@"
5 changes: 5 additions & 0 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
exit -1
fi

if [ ! -x "$(command -v node)" ]; then
echo "Node binary not found, please ensure it has been properly installed"
exit -1
fi

./node_modules/.bin/pre-commit "$@"
5 changes: 5 additions & 0 deletions hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
exit -1
fi

if [ ! -x "$(command -v node)" ]; then
echo "Node binary not found, please ensure it has been properly installed"
exit -1
fi

./node_modules/.bin/pre-push "$@"

0 comments on commit 46e73d1

Please sign in to comment.