Skip to content

Commit 46e73d1

Browse files
AVVSbahmutov
authored andcommitted
feat(hooks): verifies that node is in PATH (#113)
* feat(hooks): verifies that `node` is in PATH * chore: better wording
1 parent 6bf31c2 commit 46e73d1

File tree

6 files changed

+30
-1
lines changed

6 files changed

+30
-1
lines changed

hooks/commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
66
exit -1
77
fi
88

9+
if [ ! -x "$(command -v node)" ]; then
10+
echo "Node binary not found, please ensure it has been properly installed"
11+
exit -1
12+
fi
13+
914
./node_modules/.bin/commit-msg "$@"

hooks/post-checkout

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ if [ ! -d "$DIRECTORY" ]; then
55
echo "WARNING: Cannot find node_modules folder, please run 'npm install' first"
66
fi
77

8-
if [ -d "$DIRECTORY" ]; then
8+
if [ ! -x "$(command -v node)" ]; then
9+
echo "WARNING: Node binary not found, please ensure it has been properly installed"
10+
fi
11+
12+
if [ -d "$DIRECTORY" ] && [ -x "$(command -v node)" ]; then
913
./node_modules/.bin/post-checkout "$@"
1014
fi

hooks/post-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
66
exit -1
77
fi
88

9+
if [ ! -x "$(command -v node)" ]; then
10+
echo "Node binary not found, please ensure it has been properly installed"
11+
exit -1
12+
fi
13+
914
./node_modules/.bin/post-commit "$@"

hooks/post-merge

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
66
exit -1
77
fi
88

9+
if [ ! -x "$(command -v node)" ]; then
10+
echo "Node binary not found, please ensure it has been properly installed"
11+
exit -1
12+
fi
13+
914
./node_modules/.bin/post-merge "$@"

hooks/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
66
exit -1
77
fi
88

9+
if [ ! -x "$(command -v node)" ]; then
10+
echo "Node binary not found, please ensure it has been properly installed"
11+
exit -1
12+
fi
13+
914
./node_modules/.bin/pre-commit "$@"

hooks/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ if [ ! -d "$DIRECTORY" ]; then
66
exit -1
77
fi
88

9+
if [ ! -x "$(command -v node)" ]; then
10+
echo "Node binary not found, please ensure it has been properly installed"
11+
exit -1
12+
fi
13+
914
./node_modules/.bin/pre-push "$@"

0 commit comments

Comments
 (0)