examples: Move hook scripts to their own subdirectory.
[metastore.git] / examples / hooks / post-checkout
blobbd4de154bad7d2e7e58dc745c86c34a6efae511c
1 #!/bin/sh
3 # An example hook script to set metadata information using
4 # metastore after each checkout.
6 MSFILE=".metadata"
8 exit_on_fail() {
9 "$@"
10 if [ $? -ne 0 ]; then
11 echo "Failed to execute: $@" >&2
12 exit 1
16 if [ ! -e "$MSFILE" ]; then
17 echo "\"$MSFILE\" missing" >&2
18 exit 1
21 exit_on_fail \
22 metastore -a -m -e -E -q -f "$MSFILE"
24 exit 0