Skip to content

Commit 347cfa4

Browse files
committed
chore: fix the pre commit
1 parent 1a72a0a commit 347cfa4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.husky/pre-commit

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
#!/usr/bin/env sh
2+
# 导入 Husky 脚本
23
. "$(dirname -- "$0")/_/husky.sh"
3-
echo "lint and format before commit"
4-
#npm run lint && npm run format
4+
5+
# 检查是否处于 rebase 状态
6+
if [ -z "$GIT_DIR" ]; then
7+
# 处于 rebase 状态,退出脚本
8+
exit 0
9+
fi
10+
11+
# 不处于 rebase 状态,执行 pre-commit 脚本
12+
echo "Running pre-commit script..."
13+
npm run lint && npm run format

0 commit comments

Comments
 (0)