githook: POSIX compliance
This commit is contained in:
parent
7c06a4d79c
commit
c389feaf24
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue