系统相关
首页 > 系统相关> > linux – 如何从hubot执行shell脚本

linux – 如何从hubot执行shell脚本

作者:互联网

我启动并运行了第一个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权限),并导出HUBOT_LOG_LEVEL =“debug”.
我正在使用拥有bash脚本的同一用户运行hubot.
谢谢.

解决方法:

供参考:答案是

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

长音

标签:bash,linux,shell,coffeescript,hubot
来源: https://codeday.me/bug/20190725/1532254.html