Files
upgrading-ethereum-book/bin/util/git-pre-commit-hook.sh
2025-05-23 19:54:09 +01:00

17 lines
368 B
Bash
Executable File

#!/bin/sh
# Run the checks only if file `book.md` is staged
if git diff --exit-code -s --staged src/book.md
then
exit 0
fi
# Run the pre-build checks on the book source
node --input-type=module -e 'import runChecks from "./bin/build/prebuild.js"; runChecks()'
if [ "$?" != "0" ]
then
echo "\nError: Not committing due to failed checks.\n" >&2
exit 1
fi