Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Commit 00bcd8b

Browse files
fix: only install git hooks from inside this project's git root
This fixes a problem where running `npm i strvcom/eslint-plugin-javascript` would fail due to the _install-githooks.sh_ script not being able to find the git hooks.
1 parent 76f15dc commit 00bcd8b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

utils/install-githooks.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/sh
22

3-
echo "Installing git hooks:"
4-
echo utils/githooks/*
3+
# Only install git hooks if we are in the project's git root
4+
# Do NOT install git hooks when ie. installing this package using npm directly from Github
5+
if [ -d "utils/githooks" ]; then
6+
echo "Installing git hooks:"
7+
echo utils/githooks/*
58

6-
cp -r utils/githooks/* .git/hooks/
9+
cp -r utils/githooks/* .git/hooks/
10+
fi

0 commit comments

Comments
 (0)