我正在玩 GitHub 的 Hubot,我尝试在我的机器人工作中执行一个 bash 脚本。
我成功执行了我的脚本,但如果我向该脚本添加一些参数,它就无法正常工作。
{ spawn } = require 'child_process'
s = spawn './myScript.sh' + " url" + " title" <------- doesn't work due to args
s = spawn './myScript.sh' <------- alright without args
s.stdout.on 'data', ( data ) -> console.log "Output: #{ data }"
s.stderr.on 'data', ( data ) -> console.error "Error: #{ data }"
s.on 'close', -> console.log "'s' has finished executing."
如何将参数传递给我的脚本?
感谢帮助