git-apply-pr
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -40,5 +40,14 @@ #!/usr/bin/env node | ||
if (!process.argv[2]) { | ||
exitWithMsg('Usage example: git-apply-pr joyent/node#1337'); | ||
} | ||
var args = /(.*)\/(.*)#(\d*)/i.exec(process.argv[2]); | ||
if (!args) { | ||
exitWithMsg('Usage example: git-apply-pr joyent/node#1337'); | ||
} | ||
var OWNER = args[1]; | ||
var REPO = args[2]; | ||
var PR = +args[3]; | ||
var HOST = 'github.com'; | ||
var OWNER = 'joyent'; | ||
var REPO = 'node'; | ||
@@ -66,9 +75,12 @@ var github = new (require('github'))({ | ||
var PR = +process.argv[2]; | ||
if (typeof(PR) !== 'number' || PR < 1) { | ||
exitWithMsg('PR must be a positive number'); | ||
} | ||
//GET /repos/:owner/:repo/pulls/:number | ||
if (typeof(OWNER) !== 'string' || OWNER.length < 1) { | ||
exitWithMsg('OWNER must be a string'); | ||
} | ||
if (typeof(PR) !== 'number' || PR < 1) { | ||
console.error('PR must be a positive number'); | ||
process.exit(1); | ||
if (typeof(REPO) !== 'string' || REPO.length < 1) { | ||
exitWithMsg('REPO must be a string'); | ||
} | ||
@@ -82,2 +94,3 @@ | ||
//GET /repos/:owner/:repo/pulls/:number | ||
function getComments(page, next) { | ||
@@ -92,4 +105,3 @@ github.issues.getComments({ | ||
if (err) { | ||
console.error(err); | ||
process.exit(1); | ||
exitWithMsg(err); | ||
} | ||
@@ -120,4 +132,3 @@ | ||
if (err) { | ||
console.error(err); | ||
process.exit(1); | ||
exitWithMsg(err); | ||
} | ||
@@ -132,4 +143,3 @@ | ||
if (!queue.length) { | ||
console.error('this PR has not been LGTMd'); | ||
process.exit(1); | ||
exitWithMsg('this PR has not been LGTMd'); | ||
} | ||
@@ -218,1 +228,6 @@ | ||
}; | ||
function exitWithMsg(msg) { | ||
console.error(msg); | ||
process.exit(1); | ||
} |
{ | ||
"name": "git-apply-pr", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Apply GitHub Pull Requests", | ||
@@ -5,0 +5,0 @@ "main": "apply-pr.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
7497
5
184
1
11