aboutsummaryrefslogtreecommitdiffhomepage
path: root/.husky/pre-commit
blob: fc20b72d900acceeb4f08acc8a12ff09f914602d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

pnpm ls-lint

BRANCH_NAME=$(git branch --show-current)

if [ "$BRANCH_NAME" = "main" ]; then
  echo
  echo "Aborting commit."
  echo "You're committing to the main branch, usually this is not what you want to do."
  echo "Did you forget to make a new feature branch to put your work on?"
  echo
  echo "Use git checkout -b <new_branch> to create a new feature branch."
  echo
  echo "If you're sure you want to commit to the main branch, run git commit with the --no-verify flag."
  echo

  exit 1
fi