Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-apply-pr

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-apply-pr - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

README.md

41

apply-pr.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc