Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix bug when author doesn't include repo. make work in node 0.6.*

  • Loading branch information...
commit 5a05cf85d807c7d1d3339f7aadf6a8283e16bb06 1 parent ff9e882
@dylang authored
Showing with 10 additions and 11 deletions.
  1. +8 −6 lib/npm.js
  2. +2 −5 package.json
View
14 lib/npm.js
@@ -1,13 +1,12 @@
var Request = require('request');
var Step = require('step');
var Github = require('./github');
-var Semver = require('semver');
+var SemVer = require('semver');
var log = require('./log');
-
function sortVersions (a, b) {
- if (Semver.gt(a, b)) { return -1; }
- if (Semver.lt(a, b)) { return 1; }
+ if (SemVer.gt(a, b)) { return -1; }
+ if (SemVer.lt(a, b)) { return 1; }
return 0;
}
@@ -104,6 +103,9 @@ function changelog(packageName, releaseRequested, cb) {
Github.changes(data, this);
},
function(err, data) {
+ if (err) {
+ return cb(err);
+ }
var i;
var project;
var upcoming;
@@ -160,13 +162,13 @@ function changelog(packageName, releaseRequested, cb) {
}
// Require valid version
- } else if (!Semver.valid(releaseRequested)) {
+ } else if (!SemVer.valid(releaseRequested)) {
log.error('Invalid version syntax. Versions can be latest, an integer, or n.n.n where n are integers.')
// x.x.x then look for that specific version
} else {
Versions.forEach(function(Version) {
- if (Semver.satisfies(Version.version, releaseRequested)) {
+ if (SemVer.satisfies(Version.version, releaseRequested)) {
tmpVersions.push(Version);
}
});
View
7 package.json
@@ -13,7 +13,7 @@
},
"bugs": {
"mail": "dylang@gmail.com",
- "web": "http://github.com/dylang/changelog/issues"
+ "url": "http://github.com/dylang/changelog/issues"
},
"directories": {
"lib": "./lib",
@@ -31,11 +31,8 @@
"semver": "*",
"logging": "*"
},
- "devDependencies": {
- "logging": "*"
- },
"engines": {
- "node": "0.4 || 0.5"
+ "node": "*"
}, "licenses":[{
"type": "MIT",
"url": "http://github.com/dylang/changelog/raw/master/LICENSE"
Please sign in to comment.
Something went wrong with that request. Please try again.