Files
live-hub-py/scripts/install-git-hooks.sh
T
yml2213andCursor 874a95dd6f chore: 提交和推送前增加前端 TypeScript 检查
与 Docker 构建的 tsc -b 对齐,避免类型错误在服务器构建才暴露。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-10 11:45:35 +08:00

11 lines
393 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
git -C "$ROOT_DIR" config core.hooksPath .githooks
echo "已启用 .githooks:"
echo " pre-commit: 暂存的 Python 格式 + 前端 TypeScript"
echo " pre-push: 上述检查 + pytest"
echo " TYPECHECK=1 git push 可额外跑 Pyright"
echo "紧急绕过:git push --no-verify 或 SKIP_TESTS=1 git push"