Files
qiming/qimingclaw/.husky/prepare-commit-msg

8 lines
306 B
Bash

#!/bin/sh
# 提交前移除 Cursor 自动添加的 Co-authored-by 行
MSG_FILE="$1"
[ -f "$MSG_FILE" ] || exit 0
# 用 grep 过滤掉该行后写回,兼容 macOS/Linux
grep -v '^Co-authored-by: Cursor <cursoragent@cursor\.com>$' "$MSG_FILE" > "${MSG_FILE}.tmp" && mv "${MSG_FILE}.tmp" "$MSG_FILE"
exit 0