github-releases
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -14,3 +14,3 @@ (function() { | ||
options = optimist.usage("Usage: github-releases [--tag==<tag>] [--filename=<filename>] [--token=<token>] <command> <repo>").alias('h', 'help').describe('help', 'Print this usage message').string('token').describe('token', 'Your GitHub token').string('tag').describe('tag', 'The tag of the release')["default"]('tag', '*').string('filename').describe('filename', 'The filename of the asset')["default"]('filename', '*'); | ||
options = optimist.usage("Usage: github-releases [--tag==<tag>] [--pre] [--filename=<filename>] [--token=<token>] <command> <repo>").alias('h', 'help').describe('help', 'Print this usage message').string('token').describe('token', 'Your GitHub token').string('tag').describe('tag', 'The tag of the release').boolean('pre').describe('pre', 'Is the release a pre-release')["default"]('pre', false).string('filename').describe('filename', 'The filename of the asset')["default"]('filename', '*'); | ||
@@ -28,7 +28,11 @@ print = function(error, result) { | ||
run = function(github, command, argv, callback) { | ||
var filters; | ||
switch (command) { | ||
case 'list': | ||
return github.getReleases({ | ||
tag_name: argv.tag | ||
}, callback); | ||
filters = {}; | ||
if (argv.tag != null) { | ||
filters.tag_name = argv.tag; | ||
} | ||
filters.prerelease = argv.pre; | ||
return github.getReleases(filters, callback); | ||
case 'show': | ||
@@ -35,0 +39,0 @@ return run(github, 'list', argv, function(error, releases) { |
@@ -16,15 +16,18 @@ (function() { | ||
Filters.prototype.matches = function(str, filter) { | ||
var _i, _len, _ref; | ||
if (filter instanceof RegExp) { | ||
return filter.test(str); | ||
} else { | ||
_ref = filter.split(','); | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
filter = _ref[_i]; | ||
if (minimatch(str, filter)) { | ||
return true; | ||
Filters.prototype.matches = function(value, filter) { | ||
var filterPart, _i, _len, _ref; | ||
switch (filter.constructor) { | ||
case RegExp: | ||
return filter.test(value); | ||
case String: | ||
_ref = filter.split(','); | ||
for (_i = 0, _len = _ref.length; _i < _len; _i++) { | ||
filterPart = _ref[_i]; | ||
if (minimatch(value, filterPart)) { | ||
return true; | ||
} | ||
} | ||
} | ||
return false; | ||
return false; | ||
default: | ||
return value === filter; | ||
} | ||
@@ -31,0 +34,0 @@ }; |
{ | ||
"name": "github-releases", | ||
"description": "Node module for using GitHub Releases feature", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"main": "./lib/github.js", | ||
@@ -6,0 +6,0 @@ "bin": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
13807
249
0