diff options
author | Przemyslaw Pawelczyk <przemoc@gmail.com> | 2016-01-19 20:42:22 +0100 |
---|---|---|
committer | Przemyslaw Pawelczyk <przemoc@gmail.com> | 2016-01-19 20:42:22 +0100 |
commit | d119c8d1f5b18c6ee9c5efa90615427083875e00 (patch) | |
tree | d503ac20083e98e84e6a4cb33f021ce2d03621b0 /examples/hooks/post-checkout | |
parent | d2924f4f2f606d36ac123162c079335ce275f742 (diff) |
examples: Move hook scripts to their own subdirectory.
Diffstat (limited to 'examples/hooks/post-checkout')
-rw-r--r-- | examples/hooks/post-checkout | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/hooks/post-checkout b/examples/hooks/post-checkout new file mode 100644 index 0000000..bd4de15 --- /dev/null +++ b/examples/hooks/post-checkout @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to set metadata information using +# metastore after each checkout. + +MSFILE=".metadata" + +exit_on_fail() { + "$@" + if [ $? -ne 0 ]; then + echo "Failed to execute: $@" >&2 + exit 1 + fi +} + +if [ ! -e "$MSFILE" ]; then + echo "\"$MSFILE\" missing" >&2 + exit 1 +fi + +exit_on_fail \ + metastore -a -m -e -E -q -f "$MSFILE" + +exit 0 |