Merge branch 'dev' into test
This commit is contained in:
commit
1f32392eac
44 files changed
+2390
-1072
No files matched your search
@@ -10,7 +10,7 @@ if ! git -C "${ROOT_DIR}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
HOOKS_DIR="${ROOT_DIR}/.githooks"
|
||||
REQUIRED_HOOKS=(pre-commit pre-push _common.sh)
|
||||
REQUIRED_HOOKS=(pre-commit pre-push commit-msg _common.sh)
|
||||
|
||||
for hook_name in "${REQUIRED_HOOKS[@]}"; do
|
||||
hook_path="${HOOKS_DIR}/${hook_name}"
|
||||
@@ -28,8 +28,18 @@ if ! git -C "${ROOT_DIR}" config core.hooksPath .githooks; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "${ROOT_DIR}/package.json" ]]; then
|
||||
echo "[hook-install] Installing commitlint dependencies (npm install)..."
|
||||
if ! (cd "${ROOT_DIR}" && npm install); then
|
||||
echo "[hook-install] npm install failed. commit-msg hook requires root node_modules."
|
||||
echo "[hook-install] please run manually: cd ${ROOT_DIR} && npm install"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[hook-install] Installed Git hooks successfully."
|
||||
echo "[hook-install] pre-commit: models 变更需带 migration;frontend 暂存时跑 vue-tsc"
|
||||
echo "[hook-install] commit-msg: 校验提交信息格式(Conventional Commits)"
|
||||
echo "[hook-install] pre-push: 推送含 frontend 变更时跑 npm run build"
|
||||
echo "[hook-install] core.hooksPath=$(git -C "${ROOT_DIR}" config --get core.hooksPath)"
|
||||
echo "[hook-install] 跳过前端检查: SKIP_FRONTEND_HOOKS=1"
|
||||
|
||||
Reference in new issue
Block a user