g6/.husky/pre-commit
Aaron 36b9c6b4c3
chore: update husky and add release workflow (#6041)
* chore: update husky

* chore: update github workflows

* chore: update scripts

* chore: fix workflow
2024-07-16 15:35:47 +08:00

14 lines
333 B
Bash
Executable File

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
protected_branches="master v5"
current_branch=$(git rev-parse --abbrev-ref HEAD)
for branch in $protected_branches; do
if [ "$current_branch" == "$branch" ]; then
echo "\033[31mDirect commit to '$branch' branch are not allowed!\033[0m"
exit 1
fi
done
npx lint-staged