git-central icon indicating copy to clipboard operation
git-central copied to clipboard

get error in functions script when running post-receive-hudson

Open boxerab opened this issue 14 years ago • 6 comments

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

boxerab avatar Apr 06 '11 20:04 boxerab

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.

stephenh avatar Apr 06 '11 20:04 stephenh

Thanks! I found a number of problems; will fix and make a pull request.

boxerab avatar Apr 07 '11 14:04 boxerab

Cool--sorry, it's not awesome that you found problems, but it is awesome that you'll be fixing them. :-) Thanks!

stephenh avatar Apr 07 '11 14:04 stephenh

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.

boxerab avatar Apr 07 '11 14:04 boxerab

oops, github at my back ticks. should read seq 1 $#

boxerab avatar Apr 07 '11 14:04 boxerab

it did it again: seq 1 $# should be enclosed in back ticks

boxerab avatar Apr 07 '11 14:04 boxerab