-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhookshot.js
More file actions
executable file
·18 lines (13 loc) · 558 Bytes
/
hookshot.js
File metadata and controls
executable file
·18 lines (13 loc) · 558 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env node
var hookshot = require("hookshot");
var spawn = require("child_process").spawn;
var options = require('minimist')(process.argv.slice(2));
var branch = options.b || options.branch;
var command = options.c || options.command;
var port = options.p || options.port;
if (!branch || !command || !port) {
console.error("--branch, --command, and --port are all required.")
process.exit(1);
}
hookshot('refs/heads/' + branch, command).listen(port);
console.log("Huzzah! Listening on port " + port + " for push events on " + branch + ".")