Commit f470de4c authored by Pablo Rauzy's avatar Pablo Rauzy Committed by Christoph Cullmann
Browse files

adding example of pre-commit hook that updates the README automatically

parent c0f116aa
#!/bin/bash
#!/usr/bin/env bash
# This script uses pandoc to update the local README.md file with the content from Kate's docbook documentation.
cd $(dirname "$(readlink -f "$BASH_SOURCE")")
......@@ -10,3 +10,26 @@ sed -n '/^<sect1 id="kate-application-plugin-keyboardmacros">$/,/^<\/sect1>$/p'
cat > README.md
cd - >/dev/null
##### BEGIN git pre-commit hook script
###
### #!/usr/bin/env bash
###
### UPDATE_SCRIPT="$(dirname $(git rev-parse --git-common-dir))"/addons/keyboardmacros/update-README.md.sh
###
### test -f "$UPDATE_SCRIPT" || exit 0
###
### TMP=$(mktemp)
### README="$(dirname $(git rev-parse --git-common-dir))"/addons/keyboardmacros/README.md
### cp "$README" "$TMP"
### source "$UPDATE_SCRIPT"
###
### if ! diff -q "$README" "$TMP" &>/dev/null; then
### echo "Warning: README.md has been updated!"
### rm "$TMP"
### exit 1
### fi
### rm "$TMP"
### exit 0
###
##### END
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment