githook: POSIX compliance

This commit is contained in:
Andreas Oberritter 2022-07-18 22:49:20 +02:00
parent 7c06a4d79c
commit c389feaf24
1 changed files with 5 additions and 10 deletions

View File

@ -3,16 +3,11 @@ from pathlib import Path
PRE_PUSH_SCRIPT = """#!/bin/sh
if [[ ! -z "$VIRTUAL_ENV" ]]
then
while read -d $'\0' arg ; do
if [[ "$arg" == '--follow-tags' ]] ; then
clickusagemd run ${GIT_DIR}pyproject.toml || exit 1
git add ${GIT_DIR}USAGE.md || exit 1
git commit -m"Autogenerated USAGE.md updated and added."
exit 0
fi
done < /proc/$PPID/cmdline
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
fi
exit 0