1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/Tools/git-hooks/pre-commit-sh

13 lines
394 B
Plaintext
Raw Normal View History

2017-12-04 19:55:06 +02:00
#!/bin/sh
# In pre-commit, PWD is set to the root of the repo
# https://longair.net/blog/2011/04/09/missing-git-hooks-documentation/
ROOT_DIR="$PWD"
# If any README file has been changed, update the website
2018-03-29 01:52:27 +02:00
git status -s | grep ' README\| readme\| build-website.js' > /dev/null 2>&1
2017-12-04 19:55:06 +02:00
readmeStatus=$?
if [ $readmeStatus -eq 0 ]; then
node "$ROOT_DIR/Tools/build-website.js"
git add docs
fi