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
2017-12-04 23:01:22 +00:00

13 lines
384 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\| build-website.js' > /dev/null 2>&1
readmeStatus=$?
if [ $readmeStatus -eq 0 ]; then
node "$ROOT_DIR/Tools/build-website.js"
git add docs
fi