forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgithub_closes.js
More file actions
36 lines (29 loc) · 767 Bytes
/
github_closes.js
File metadata and controls
36 lines (29 loc) · 767 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
35
36
#!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var msg = '';
if (require.main === module) {
process.stdin.setEncoding('utf8');
process.stdin.on('readable', () => {
const chunk = process.stdin.read();
if (chunk !== null) {
msg += chunk;
}
});
process.stdin.on('end', () => {
var argv = process.argv.slice(2);
console.info(rewriteMsg(msg, argv[0]));
});
}
function rewriteMsg(msg, prNo) {
var lines = msg.split(/\n/);
lines[0] += ' (#' + prNo + ')';
lines.push('PR Close #' + prNo);
return lines.join('\n');
}
exports.rewriteMsg = rewriteMsg;