Skip to content

Commit

Permalink
Fix hooks-install
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Oct 19, 2023
1 parent 6c28d07 commit 9ea3d5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"preversion": "./scripts/preversion.sh",
"version": "./scripts/version.sh",
"postversion": "./scripts/postversion.sh",
"postinstall": "git config --replace-all core.hooksPath scripts/hooks"
"postinstall": "./scripts/setup-hooks"
},
"nyc": {
"instrument": false,
Expand Down
11 changes: 11 additions & 0 deletions scripts/setup-hooks
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# ensure all commands are run from the root dir, for simplicity
cd "$SCRIPT_DIR/.."

# only install git hooks for people developing Sinon
if basename $PWD > /dev/null && [[ -e .git/config ]] ; then
git config --replace-all core.hooksPath scripts/hooks
fi

0 comments on commit 9ea3d5b

Please sign in to comment.