CoffeeScript pass child process result to variable -
i trying understand why code not passing stdout
tasklist
, within childp.exec
msg.send
works fine tasklist
empty string.
cmd = "cd #{directory}; \ bundle exec rake -t | perl -lne 'print if /^rake (clear|integration):/'" tasklist = "" childp = require 'child_process' childp.exec cmd, (error, stdout, stderr) => if error? msg.send ":x: error rake task lists" homecoming else msg.send stdout # works fine, can see list of rake tasks want tasklist = stdout msg.send typeof tasklist # homecoming 'string' msg.send tasklist # empty string sent
any suggestions ?
coffeescript
No comments:
Post a Comment