Peach: Local-first video metadata scraper and media manager.
#!/bin/sh
# 解析与字段判据由 Python 检查器和交付门槛共用。
root=$(git rev-parse --show-toplevel) || exit 1
common=$(git rev-parse --path-format=absolute --git-common-dir) || exit 1
main=$(dirname "$common")
for candidate in "$root/.venv/Scripts/python.exe" "$root/.venv/bin/python" \
"$main/.venv/Scripts/python.exe" "$main/.venv/bin/python"; do
if [ -x "$candidate" ]; then
exec "$candidate" -B -X utf8 "$root/scripts/check_commit_message.py" "$1"
fi
done
for candidate in python python3; do
if command -v "$candidate" >/dev/null 2>&1; then
exec "$candidate" -B -X utf8 "$root/scripts/check_commit_message.py" "$1"
fi
done
echo "未取得 Python,无法校验提交 trailer。" >&2
exit 1