4

I got my first hubot up and running, and wrote my first few scripts based on the existing examples. My existing workflow, which I would like to integrate with hubot, is essentially based on several shell scripts, each one of them performing one task. The task can be relatively complex (git/svn checkout, compiling code with gcc, and running it). How can I execute a bash script with hubot? I have seen this question, but it only addresses simple commands such as ls. I tried

build = spawn 'source', ['test.sh']
build.stdout.on 'data', (data) -> msg.send data.toString()
build.stderr.on 'data', (data) -> msg.send data.toString()

without any luck:

Hubot> execvp(): Permission denied

I checked the obvious things (-rwxr-xr-x permissions), and export HUBOT_LOG_LEVEL="debug". I am running hubot with the same user that owns the bash scripts. Thanks.

2
  • Give complete path to test.sh? Commented Dec 2, 2013 at 7:31
  • I tried both without any luck: to give the complete path to test.sh and to call process.chdir(scriptDir) before calling source. Commented Dec 2, 2013 at 21:11

2 Answers 2

5

For reference: the answer was

build = spawn '/bin/bash', ['test.sh']

Dah

Sign up to request clarification or add additional context in comments.

Comments

5
npm install hubot-script-shellcmd

is your doorway to the shell.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.