hookshot.js 558 B

123456789101112131415161718
  1. #!/usr/bin/env node
  2. var hookshot = require("hookshot");
  3. var spawn = require("child_process").spawn;
  4. var options = require('minimist')(process.argv.slice(2));
  5. var branch = options.b || options.branch;
  6. var command = options.c || options.command;
  7. var port = options.p || options.port;
  8. if (!branch || !command || !port) {
  9. console.error("--branch, --command, and --port are all required.")
  10. process.exit(1);
  11. }
  12. hookshot('refs/heads/' + branch, command).listen(port);
  13. console.log("Huzzah! Listening on port " + port + " for push events on " + branch + ".")