summaryrefslogtreecommitdiff
path: root/examples/hooks/post-merge
blob: 938305f87bb9599ab1fcc77779c484c9bd1bce1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
# An example hook script to set metadata information using
# metastore after a successful merge

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