Skip to content

Commit

Permalink
Merge pull request #71 from rootstrap/fix/husky_pre_commit_hook_not_w…
Browse files Browse the repository at this point in the history
…orking_for_new_projects

fix(husky): pre-commit hook not working for new projects
  • Loading branch information
asdolo authored Sep 12, 2024
2 parents 10f4f87 + 95ffee9 commit 41a9c6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm commitlint --edit $1
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"


echo "===\n>> Checking branch name..."

# Check if branch protection is enabled
if [[ -z $SKIP_BRANCH_PROTECTION ]]; then
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BRANCH=$(git branch --show-current)
PROTECTED_BRANCHES="^(main|master)"

if [[ $BRANCH =~ $PROTECTED_BRANCHES ]]; then
Expand Down

0 comments on commit 41a9c6e

Please sign in to comment.