cursor Init 完善多人协同changelog,以及godot相关基础skill和代码规范
This commit is contained in:
16
.cursor/changelog/tools/install-git-hooks.sh
Normal file
16
.cursor/changelog/tools/install-git-hooks.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# install-git-hooks.sh — 把 changelog 的 pre-commit / post-merge git hook 装进本仓库。
|
||||
# git hook 不随仓库分发,每个克隆都要跑一次本脚本(幂等)。
|
||||
# 用法:sh .cursor/changelog/tools/install-git-hooks.sh
|
||||
|
||||
set -e
|
||||
HOOKS_DIR=$(git rev-parse --git-path hooks 2>/dev/null) || { echo "不在 git 仓库内"; exit 1; }
|
||||
mkdir -p "$HOOKS_DIR"
|
||||
|
||||
SRC=$(CDPATH= cd -- "$(dirname -- "$0")/git-hooks" && pwd)
|
||||
for name in pre-commit post-merge; do
|
||||
cp -f "$SRC/$name" "$HOOKS_DIR/$name"
|
||||
chmod +x "$HOOKS_DIR/$name"
|
||||
echo "installed: $HOOKS_DIR/$name"
|
||||
done
|
||||
echo "完成。git hook 已安装(pre-commit 重建并纳入视图,post-merge 合并后重建)。"
|
||||
Reference in New Issue
Block a user