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

gh

Package Overview
Dependencies
Maintainers
2
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh - npm Package Compare versions

Comparing version 1.8.2 to 1.8.3

lib/cmds/templates/gi-list.handlebars

1

.gh.json

@@ -49,2 +49,3 @@ {

"after": [
"gh pr {{options.submittedPullNumber}} --user {{options.fwd}} --comment '/cc @{{options.submittedUser}}'",
"gh pr {{options.number}} --comment 'Pull request forwarded to {{forwardedLink}}.{{#if options.changes}} [See changes here.]({{compareLink}}){{/if}}'",

@@ -51,0 +52,0 @@ "gh pr {{options.number}} --close"

@@ -12,2 +12,4 @@ #!/usr/bin/env node

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -14,0 +16,0 @@

@@ -8,6 +8,24 @@ /*

* @author Zeno Rocha <zno.rocha@gmail.com>
* @author Eduardo Lundgren <eduardo.lundgren@gmail.com>
*/
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
bump: {
options: {
commit: true,
commitFiles: ['package.json'],
commitMessage: 'Release v%VERSION%',
createTag: true,
files: ['package.json'],
push: true,
pushTo: 'origin',
tagMessage: '',
tagName: 'v%VERSION%'
}
},
jsbeautifier: {

@@ -18,8 +36,49 @@ files: ['bin/*.js', 'lib/**/*.js', 'test/**/*.js', '*.js'],

}
},
jshint: {
gruntfile: 'Gruntfile.js',
lib: {
src: ['bin/*.js', 'lib/**/*.js']
},
options: grunt.file.readJSON('.jshintrc'),
test: {
options: grunt.file.readJSON('test/.jshintrc'),
src: ['test/**/*.js']
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
slow: 1500,
timeout: 50000
},
src: ['test/**/*.js']
}
},
watch: {
files: [
'Gruntfile.js',
'<%= jshint.lib.src %>',
'<%= jshint.test.src %>'
],
tasks: ['lint', 'test']
}
});
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('ci', ['lint', 'test']);
grunt.registerTask('default', ['lint', 'test']);
grunt.registerTask('format', ['jsbeautifier']);
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test', ['mochaTest']);
};

4

lib/base.js

@@ -10,2 +10,4 @@ /*

'use strict';
var fs = require('fs'),

@@ -190,3 +192,3 @@ moment = require('moment'),

return moment.duration(moment(opt_end).diff(start)).humanize(true);
return moment.duration(moment(start).diff(opt_end)).humanize(true);
};

@@ -193,0 +195,0 @@

@@ -11,2 +11,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -13,0 +15,0 @@

@@ -12,2 +12,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -38,2 +40,3 @@

'fork',
'list',
'new'

@@ -48,5 +51,7 @@ ],

'id': String,
'list': Boolean,
'new': String,
'paste': Boolean,
'private': Boolean
'private': Boolean,
'user': String
},

@@ -60,8 +65,10 @@ shorthands: {

'i': ['--id'],
'l': ['--list'],
'N': ['--new'],
'P': ['--paste'],
'p': ['--private']
'p': ['--private'],
'u': ['--user']
},
payload: function(payload, options) {
options.browser = true;
options.list = true;
}

@@ -127,2 +134,13 @@ };

if (options.list) {
logger.logTemplate(
'{{prefix}} [info] Listing gists for {{greenBright options.user}}', {
options: options
});
instance.list(options.user, function(err) {
logger.defaultCallback(err, null, false);
});
}
if (options.new) {

@@ -180,2 +198,33 @@ hooks.invoke('gists.new', instance, function(afterHooksCallback) {

Gists.prototype.list = function(user, opt_callback) {
var instance = this,
payload;
payload = {
user: user
};
base.github.gists.getFromUser(payload, function(err, gists) {
instance.listCallback_(err, gists, opt_callback);
});
};
Gists.prototype.listCallback_ = function(err, gists, opt_callback) {
var instance = this,
options = instance.options;
if (err && !options.all) {
logger.error(logger.getErrorMessage(err));
}
if (gists && gists.length > 0) {
logger.logTemplateFile('gi-list.handlebars', {
gists: gists,
user: options.user
});
opt_callback && opt_callback(err);
}
};
Gists.prototype.new = function(name, content, opt_callback) {

@@ -182,0 +231,0 @@ var instance = this,

@@ -10,2 +10,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -12,0 +14,0 @@

@@ -11,2 +11,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -13,0 +15,0 @@

@@ -11,2 +11,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -13,0 +15,0 @@

@@ -11,2 +11,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -126,7 +128,7 @@

logger.logTemplateFile('notification.handlebars', {
events: filteredListEvents,
latest: options.latest,
repo: options.repo,
user: options.user,
repo: options.repo,
latest: options.latest,
watch: opt_watch,
events: filteredListEvents
watch: opt_watch
});

@@ -133,0 +135,0 @@ }

@@ -11,2 +11,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -20,3 +22,3 @@

openUrl = require('open'),
issueImpl = require('./issue').Impl,
Issues = require('./issue').Impl,
config = base.getConfig();

@@ -33,3 +35,3 @@

this.issue = new issueImpl(options);
this.issue = new Issues(options);
}

@@ -392,3 +394,5 @@

function(callback) {
git.exec('fetch', [repoUrl, headBranch + ':' + options.pullBranch], callback);
git.exec('fetch', [repoUrl, headBranch + ':' + options.pullBranch], function(status, err) {
callback(err);
});
},

@@ -432,3 +436,8 @@ function(callback) {

options.title = pull.title;
options.description = pull.body;
options.submittedUser = pull.user.login;
instance.submit(options.fwd, function(err, data) {
options.submittedPullNumber = data.number;
submittedPull = data;

@@ -435,0 +444,0 @@ callback(err);

@@ -12,2 +12,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -168,3 +170,3 @@

logger.logTemplate(
'{{prefix}} [info] Creating a new repo on {{greenBright options.user "/" options.new}}', {
'{{prefix}} [info] Creating a new repo on {{greenBright options.loggedUser "/" options.new}}', {
options: options

@@ -178,3 +180,3 @@ });

url.parse(repo.ssh_url).href,
null,
options.new,
function(err2, data) {

@@ -181,0 +183,0 @@ console.log(data);

@@ -12,2 +12,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -14,0 +16,0 @@

@@ -10,2 +10,4 @@ /*

'use strict';
var base = require('./base'),

@@ -12,0 +14,0 @@ spawn = require('child_process').spawn,

@@ -10,2 +10,4 @@ /*

'use strict';
var async = require('async'),

@@ -12,0 +14,0 @@ base = require('./base'),

@@ -11,2 +11,4 @@ /*

'use strict';
var base = require('./base'),

@@ -13,0 +15,0 @@ clc = require('cli-color'),

{
"name": "gh",
"description": "GitHub command line tools.",
"version": "1.8.2",
"homepage": "http://nodegh.io",
"author": {
"name": "Eduardo Lundgren",
"email": "eduardolundgren@gmail.com",
"web": "http://www.eduardo.io",
"twitter": "eduardolundgren"
},
"contributors": [{
"name": "Zeno Rocha",
"email": "zno.rocha@gmail.com",
"web": "http://zenorocha.com",
"twitter": "zenorocha"
}],
"license": "BSD",
"repository": {
"type": "git",
"url": "git@github.com:node-gh/gh.git"
},
"bugs": {
"url": "https://github.com/node-gh/gh/issues"
},
"keywords": [
"git", "github", "external", "commands", "helpers"
],
"bin": {
"gh": "bin/gh.js"
},
"scripts": {
"lint": "node_modules/.bin/jshint bin/ lib/ test/",
"test": "node_modules/.bin/mocha --reporter list"
},
"dependencies": {
"async": "~0.2.9",
"cli-color": "~0.2.3",
"cli-log": "~0.0.8",
"copy-paste": "~0.1.0",
"moment": "~2.4.0",
"handlebars": "1.0.11",
"github": "~0.1.12",
"inquirer": "~0.3.4",
"wordwrap": "~0.0.2",
"nopt": "~2.1.2",
"open": "~0.0.4",
"truncate": "~1.0.2",
"update-notifier": "~0.1.7",
"userhome": "~0.1.0",
"which": "~1.0.5"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-jsbeautifier": "~0.2.2",
"jshint": "~2.3.0",
"mocha": "~1.12.0"
},
"engines": {
"node": ">=0.8 <0.12"
},
"preferGlobal": "true"
}
"name": "gh",
"description": "GitHub command line tools.",
"version": "1.8.3",
"homepage": "http://nodegh.io",
"author": {
"name": "Eduardo Lundgren",
"email": "eduardolundgren@gmail.com",
"web": "http://eduardo.io",
"twitter": "eduardolundgren"
},
"contributors": [
{
"name": "Zeno Rocha",
"email": "zno.rocha@gmail.com",
"web": "http://zenorocha.com",
"twitter": "zenorocha"
}
],
"license": "BSD",
"repository": {
"type": "git",
"url": "git@github.com:node-gh/gh.git"
},
"bugs": {
"url": "https://github.com/node-gh/gh/issues"
},
"keywords": [
"git",
"github",
"external",
"commands",
"helpers"
],
"bin": {
"gh": "bin/gh.js"
},
"scripts": {
"test": "grunt ci"
},
"dependencies": {
"async": "~0.2.9",
"cli-color": "~0.2.3",
"cli-log": "~0.0.8",
"copy-paste": "~0.1.0",
"github": "~0.1.12",
"handlebars": "1.0.11",
"inquirer": "~0.3.4",
"moment": "~2.4.0",
"nopt": "~2.1.2",
"open": "~0.0.4",
"truncate": "~1.0.2",
"update-notifier": "~0.1.7",
"userhome": "~0.1.0",
"which": "~1.0.5",
"wordwrap": "~0.0.2"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-bump": "0.0.11",
"grunt-cli": "~0.1.9",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-jsbeautifier": "0.2.2",
"grunt-mocha-test": "~0.7.0",
"mocha": "~1.12.0"
},
"engines": {
"node": ">=0.8 <0.12"
},
"preferGlobal": "true"
}

@@ -1,2 +0,2 @@

# Node GH [![Build Status](https://secure.travis-ci.org/node-gh/gh.png?branch=master)](https://travis-ci.org/node-gh/gh) [![NPM version](https://badge.fury.io/js/gh.png)](http://badge.fury.io/js/gh) [![Dependency Status](https://david-dm.org/node-gh/gh.png)](https://david-dm.org/node-gh/gh) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/node-gh/gh/trend.png)](https://bitdeli.com/free)
# Node GH [![Build Status](https://secure.travis-ci.org/node-gh/gh.png?branch=master)](https://travis-ci.org/node-gh/gh) [![NPM version](https://badge.fury.io/js/gh.png)](http://badge.fury.io/js/gh) [![Dependency Status](https://david-dm.org/node-gh/gh.png)](https://david-dm.org/node-gh/gh)

@@ -23,3 +23,3 @@ ![Class Octocat](http://nodegh.io/images/class-octocat.jpg)

* [Plugins](#plugins)
* [Testing](#testing)
* [Tasks](#tasks)
* [Team](#team)

@@ -93,3 +93,3 @@ * [Contributing](#contributing)

* List open pulls requests for all branches.
* List open pulls requests for all branches from all your repositories.

@@ -604,3 +604,3 @@ ```

* List all repositories for someone.
* List all repositories from someone.

@@ -711,4 +711,25 @@ ```

### 2. Create
### 2. List
Option | Usage | Type
--- | --- | ---
`-l`, `--list` | **Required** | `Boolean`
`-u`, `--user` | *Optional* | `String`
#### Examples
* List all gists.
```
gh gi --list
```
* List all gists from someone.
```
gh gi --list --user brunocoelho
```
### 3. Create
Option | Usage | Type

@@ -743,3 +764,3 @@ --- | --- | ---

### 3. Fork
### 4. Fork

@@ -759,3 +780,3 @@ Option | Usage | Type

### 4. Delete
### 5. Delete

@@ -942,10 +963,22 @@ Option | Usage | Type

## Testing
## Tasks
Check [Travis](https://travis-ci.org/node-gh/gh) for continous integration results.
* Bump package version, create tag, commit and push.
```
grunt bump # v0.0.1
grunt bump:minor # v0.1.0
grunt bump:major # v1.0.0
```
* Run [JSBeautifier](http://jsbeautifier.org/), a tool to format code.
```
grunt format
```
* Run [JSHint](http://www.jshint.com/), a tool to detect errors and potential problems.
```
npm run-script lint
grunt lint
```

@@ -956,5 +989,17 @@

```
npm run-script test
grunt test
```
* Watch for changes and run `lint` and `test` tasks.
```
grunt watch
```
* Shortcut for `jshint` and `mochaTest` tasks.
```
grunt
```
## Team

@@ -964,8 +1009,13 @@

[![Eduardo Lundgren](http://gravatar.com/avatar/42327de520e674a6d1686845b30778d0?s=70)](https://github.com/eduardolundgren/) | [![Zeno Rocha](http://gravatar.com/avatar/e190023b66e2b8aa73a842b106920c93?s=70)](https://github.com/zenorocha/)
--- | ---
[Eduardo Lundgren](https://github.com/eduardolundgren/) | [Zeno Rocha](https://github.com/zenorocha/)
[![Eduardo Lundgren](http://gravatar.com/avatar/42327de520e674a6d1686845b30778d0?s=70)](https://github.com/eduardolundgren/) | [![Zeno Rocha](http://gravatar.com/avatar/e190023b66e2b8aa73a842b106920c93?s=70)](https://github.com/zenorocha/) | [![Henrique Vicente](http://gravatar.com/avatar/5733fd332f2a0da11931e0e73ddfb20d?s=70)](https://github.com/henvic/) | [![Bruno Coelho](http://gravatar.com/avatar/1f90c690b534779560d3bfdb23772915?s=70)](https://github.com/brunocoelho/)
--- | --- | --- | ---
[Eduardo Lundgren](https://github.com/eduardolundgren/) | [Zeno Rocha](https://github.com/zenorocha/) | [Henrique Vicente](https://github.com/henvic/) | [Bruno Coelho](https://github.com/brunocoelho/)
## Contributing
If you want to fix bugs or add new features you'll need to run in development environment.
1. Remove the installed version from NPM: `npm rm -g gh`
2. Go to the package folder and create a symlink: `npm link`
Contribute new commands to this project by copying and editing the content of [Hello World](https://github.com/node-gh/gh/blob/master/lib/cmds/hello.js) example.

@@ -972,0 +1022,0 @@

@@ -11,2 +11,4 @@ /*

'use strict';
// -- Requires -------------------------------------------------------------------------------------

@@ -13,0 +15,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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