1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/Tools/git-hooks/pre-commit-sh
2018-03-29 00:52:27 +01:00

13 lines
394 B
Bash

#!/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
git status -s | grep ' README\| readme\| build-website.js' > /dev/null 2>&1
readmeStatus=$?
if [ $readmeStatus -eq 0 ]; then
node "$ROOT_DIR/Tools/build-website.js"
git add docs
fi