Skip to content

Commit

Permalink
fix husky.sh syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Feb 12, 2020
1 parent 7791433 commit 015f3aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sh/husky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ hookIsDefined () {
.huskyrc \
.huskyrc.json \
.huskyrc.yaml \
.huskyrc.yml \
.huskyrc.yml
}

huskyVersion="0.0.0"
Expand All @@ -55,7 +55,10 @@ fi
debug "Current working directory is $(pwd)"

# Skip fast if hookName is not defined
if ! hookIsDefined; then
# Don't skip if .huskyrc.js or .huskyrc.config.js are used as the heuristic could
# fail due to the dynamic aspect of JS. For example:
# `"pre-" + "commit"` or `require('./config/hooks')`)
if [ ! -f .huskyrc.js ] && [ ! -f .huskyrc.config.js ] && ! hookIsDefined; then
debug "$hookName config not found, skipping hook"
exit 0
fi
Expand Down

0 comments on commit 015f3aa

Please sign in to comment.