summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgithooks/merchant/post-receive15
1 files changed, 11 insertions, 4 deletions
diff --git a/githooks/merchant/post-receive b/githooks/merchant/post-receive
index 54afab2..77a817d 100755
--- a/githooks/merchant/post-receive
+++ b/githooks/merchant/post-receive
@@ -5,13 +5,20 @@ import os
lines = sys.stdin.readlines()
-updated = {}
+updated = set()
for line in lines:
- old, new, name = line.split()
+ try:
+ old, new, name = line.split()
+ except ValueError:
+ print("unexpected format")
+ os.exit(1)
updated.add(name)
if "refs/heads/test" in updated:
- os.system("echo merchant | timeout 1s tee rebuild")
- print("updating merchant")
+ ret = os.system("echo merchant | timeout 1s tee /home/test/rebuild >/dev/null")
+ if ret != 0:
+ print("merchant update failed")
+ else:
+ print("updating merchant")