git-central
git-central copied to clipboard
get error in functions script when running post-receive-hudson
Hi Stephen,
I am trying to get your script running for a test project called test77. I've placed both post-receive-hudson and functions files in the hooks directory. But, I get the following error:
/home/git/repositories/test77.git/hooks/functions: 88: Syntax error: "(" unexpected
Thanks!
Aaron
Hi Aaron,
Unfortunately that's one of the hooks I don't have a test for. It's been awhile since I've used it. On a lark, can you try changing /bin/sh to /bin/bash on the first line and seeing it that works? If it doesn't, I'll look harder.
Thanks! I found a number of problems; will fix and make a pull request.
Cool--sorry, it's not awesome that you found problems, but it is awesome that you'll be fixing them. :-) Thanks!
ok, not much needed to change, it turns out. In your functions script, I had to remove the "function" at the beginning of each function (since you already have c style brackets).
Also, the loop in the display_error_message wasn't working for me. I replaced it with:
for i in seq 1 $#
do
.....
done
Note: I know nothing about bash shell scripting.
oops, github at my back ticks. should read
it did it again: seq 1 $# should be enclosed in back ticks