Last active
January 2, 2016 00:59
-
-
Save jefftriplett/8227394 to your computer and use it in GitHub Desktop.
A really basic hubot fabric wrapper. Works for me but this is just the basics. Set an environment variable for `HUBOT_FABRIC_PATH` and try `fab help` or `fabric help` to get a list of commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fab <command> - to manage fabric | |
{spawn, exec} = require 'child_process' | |
fabric_path = process.env.HUBOT_FABRIC_PATH | |
fabric_bin = "cd " + fabric_path + " && fab " | |
module.exports = (robot) -> | |
robot.respond /(fab|fabric) ?([\w .-]+)/i, (msg) -> | |
if msg.match[2] != undefined | |
if msg.match[2] == "help" | |
exec fabric_bin + " --list", (err, stdout, stderr) -> | |
if err | |
msg.send "ERROR: " + err | |
else | |
msg.send stdout | |
else | |
exec fabric_bin + msg.match[2], (err, stdout, stderr) -> | |
msg.send stdout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment