diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 037004a3c..93cf6531c 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -32,7 +32,8 @@ name: Markdown Table of Contents entry: >- bash -eu -o pipefail -c - "echo ARGS: \"$@\"; for f in $@; do - [ -f \"$f\" ] && markdown-toc -i $f; + "for f in $@; do + [[ \"x$f\" = x--* ]] && export MDTOC_ARGS=\"$f $MDTOC_ARGS\" && continue; + [ -f \"$f\" ] && markdown-toc $MDTOC_ARGS -i $f; done" language: system