Permalink
Browse files

Added knife show

  • Loading branch information...
1 parent 3d5fff0 commit 7c956d05e17ba748bdc6fa56b1dd3db269901eb6 @shunwen shunwen committed Oct 31, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 chef.coffee
View
12 chef.coffee
@@ -20,6 +20,18 @@ module.exports = (robot) ->
msg.send stdout
msg.send stderr
+ robot.respond /knife (node|role|client) show (.*)$/i, (msg) ->
+ spawn = require('child_process').spawn
+ subcmd = msg.match[1]
+ name = msg.match[2]
+ command = "knife #{subcmd} show #{name}"
+ msg.send "Running: #{command}"
+ @exec = require('child_process').exec
+ @exec command, (error, stdout, stderr) ->
+ msg.send error
+ msg.send stdout
+ msg.send stderr
+
robot.respond /uptime (.*)$/i, (msg) ->
spawn = require('child_process').spawn

0 comments on commit 7c956d0

Please sign in to comment.