We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 001b99d commit f60a363Copy full SHA for f60a363
.husky/pre-commit
@@ -1,17 +1,8 @@
1
# 1) 将 /images/* 文章图片就近复制并更新引用
2
-# 记录迁移前的变更状态
3
-BEFORE_STATUS=$(git status --porcelain)
4
-
5
pnpm migrate:images || exit 1
6
7
-# 检查迁移后是否有新的变更
8
-AFTER_STATUS=$(git status --porcelain)
9
10
-if [ "$BEFORE_STATUS" != "$AFTER_STATUS" ]; then
11
- echo "检测到迁移脚本产生了变更,添加所有变更到暂存区以确保完整提交..."
12
- # 只添加由于迁移产生的变更,而不是用户未暂存的所有变更
13
- git add -u
14
-fi
+# 将迁移后的变更加入暂存,确保本次提交包含更新
+git add -A
15
16
# 2) 校验图片路径与命名(不合规则阻止提交)
17
pnpm lint:images || exit 1
0 commit comments