AUTHORS: Add Edvinas Valatka.
[metastore.git] / examples / pre-commit
blobb91635d646d63d13ae834d15026c95fe6e074ec4
1 #!/bin/sh
3 # An example hook script to store metadata information using
4 # metastore on each commit.
6 MSFILE=".metadata"
8 exit_on_fail() {
9 "$@"
10 if [ $? -ne 0 ]; then
11 echo "Failed to execute: $@" >&2
12 exit 1
16 exit_on_fail \
17 metastore -s -f "$MSFILE"
19 if [ ! -e "$MSFILE" ]; then
20 echo "\"$MSFILE\" missing" >&2
21 exit 1
24 exit_on_fail \
25 git-add "$MSFILE"
27 exit 0