repo.or.cz
/
metastore.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
AUTHORS: Add Edvinas Valatka.
[metastore.git]
/
examples
/
pre-commit
blob
b91635d646d63d13ae834d15026c95fe6e074ec4
1
#!/bin/sh
2
#
3
# An example hook script to store metadata information using
4
# metastore on each commit.
5
6
MSFILE
=
".metadata"
7
8
exit_on_fail
() {
9
"$@"
10
if
[
$?
-ne
0
];
then
11
echo
"Failed to execute: $@"
>&
2
12
exit
1
13
fi
14
}
15
16
exit_on_fail \
17
metastore
-s -f
"
$MSFILE
"
18
19
if
[ !
-e
"
$MSFILE
"
];
then
20
echo
"
\"
$MSFILE
\"
missing"
>&
2
21
exit
1
22
fi
23
24
exit_on_fail \
25
git-add
"
$MSFILE
"
26
27
exit
0