Skip to content

Instantly share code, notes, and snippets.

@garaemon
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save garaemon/e7d272957edfcc1229f3 to your computer and use it in GitHub Desktop.

Select an option

Save garaemon/e7d272957edfcc1229f3 to your computer and use it in GitHub Desktop.
child_process = require 'child_process'
# put this script under hubotdir/scripts
module.exports = (robot) ->
robot.respond /eval\s+(.*)$/i, (msg) ->
sexp = msg.match[1]
child_process.exec "sbcl --noinform--quit --eval \"(print #{sexp})\"", (error, stdout, stderr) ->
if !error
output = stdout+''
msg.send output
else
msg.send "error"
console.log(error)
console.log(stderr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment