Skip to content

Instantly share code, notes, and snippets.

@atmos
Created October 1, 2012 08:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save atmos/3810246 to your computer and use it in GitHub Desktop.
Save atmos/3810246 to your computer and use it in GitHub Desktop.
# Utility commands surrounding Hubot uptime.
spawn = require('child_process').spawn
module.exports = (robot) ->
robot.hear /hubot (who|where) are you\??/i, (msg) ->
msg.finish()
child = spawn('/bin/sh', ['-c', "echo I\\'m $LOGNAME@$(hostname):$(pwd) \\($(git rev-parse HEAD)\\)"])
child.stdout.on 'data', (data) ->
msg.send "#{data.toString().trim()} running node #{process.version} [version: #{robot.version}, pid: #{process.pid}, name: #{robot.name} ]"
child.stdin.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment