-
Notifications
You must be signed in to change notification settings - Fork 361
Expand file tree
/
Copy pathland
More file actions
executable file
·37 lines (26 loc) · 821 Bytes
/
land
File metadata and controls
executable file
·37 lines (26 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env node
var url = "https://github.com/jshint/jshint/pull/" + process.argv[2] + ".patch";
var https = require("https");
var shjs = require("shelljs");
var opts = require("url").parse(url);
var msg = process.argv[3];
opts.rejectUnauthorized = false;
opts.agent = new https.Agent(opts);
https.get(opts, succ).on("error", err);
function succ(res) {
if (res.statusCode !== 200)
return void console.log("error:", res.statusCode);
var data = "";
res.on("data", function (chunk) {
data += chunk.toString();
});
res.on("end", function () {
data = data.split("\n");
data = data[1].replace(/^From\:\s/, "");
data = data.replace(/"/g, "");
shjs.exec("git commit -s --author=\"" + data + "\" --message=\"" + msg + "\"");
})
}
function err(res) {
console.log("error:", res.message);
}