【发布时间】:2013-12-17 19:36:55
【问题描述】:
我启动并运行了我的第一个 hubot,并根据现有示例编写了我的前几个脚本。我想与hubot集成的现有工作流程基本上基于几个shell脚本,每个脚本都执行一项任务。该任务可能相对复杂(git/svn checkout,使用 gcc 编译代码并运行它)。如何使用 hubot 执行 bash 脚本?我见过this question,但它只处理简单的命令,例如ls。我试过了
build = spawn 'source', ['test.sh']
build.stdout.on 'data', (data) -> msg.send data.toString()
build.stderr.on 'data', (data) -> msg.send data.toString()
运气不好:
Hubot> execvp(): Permission denied
我检查了明显的东西(-rwxr-xr-x 权限)和export HUBOT_LOG_LEVEL="debug"。
我正在使用拥有 bash 脚本的同一用户运行 hubot。
谢谢。
【问题讨论】:
-
给出
test.sh的完整路径? -
我都试过了,但都没有运气:给出
test.sh的完整路径并在调用source之前调用process.chdir(scriptDir)。
标签: linux bash shell coffeescript hubot