githook: Call poetry, commit only on demand

This commit is contained in:
Andreas Oberritter 2022-07-18 23:02:34 +02:00
parent b6f0b80baf
commit ce00aaf85b
1 changed files with 3 additions and 3 deletions

View File

@ -5,9 +5,9 @@ PRE_PUSH_SCRIPT = """#!/bin/sh
set -e
if [ -n "$VIRTUAL_ENV" ] && grep -qz '^--follow-tags$' /proc/$PPID/cmdline; then
clickusagemd run ${GIT_DIR}pyproject.toml
git commit -m "Updated USAGE.md" ${GIT_DIR}USAGE.md
if grep -qz '^--follow-tags$' /proc/$PPID/cmdline; then
poetry run clickusagemd run pyproject.toml
git diff USAGE.md >/dev/null || git commit -m "Updated USAGE.md" USAGE.md
fi
exit 0