diff options
Diffstat (limited to 'lib/outdated.js')
-rw-r--r-- | lib/outdated.js | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index 5cae20043..8b0a43d6b 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -89,11 +89,11 @@ function outdated (args, silent, cb) { } else { var outList = list.map(makePretty) var outHead = [ 'Package', - 'Current', - 'Wanted', - 'Latest', - 'Location' - ] + 'Current', + 'Wanted', + 'Latest', + 'Location' + ] if (long) outHead.push('Package Type') var outTable = [outHead].concat(outList) @@ -117,25 +117,19 @@ function outdated (args, silent, cb) { // [[ dir, dep, has, want, latest, type ]] function makePretty (p) { - var dep = p[0] var depname = p[1] - var dir = dep.path var has = p[2] var want = p[3] var latest = p[4] var type = p[6] var deppath = p[7] - if (!npm.config.get('global')) { - dir = path.relative(process.cwd(), dir) - } - var columns = [ depname, - has || 'MISSING', - want, - latest, - deppath - ] + has || 'MISSING', + want, + latest, + deppath + ] if (long) columns[5] = type if (npm.color) { @@ -183,10 +177,10 @@ function makeJSON (list) { dir = path.relative(process.cwd(), dir) } out[depname] = { current: has, - wanted: want, - latest: latest, - location: dir - } + wanted: want, + latest: latest, + location: dir + } if (long) out[depname].type = type }) return JSON.stringify(out, null, 2) @@ -317,11 +311,11 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { // show user that no viable version can be found if (er) return cb(er) outdated_(args, - pkgpath, - tree, - has, - depth + 1, - cb) + pkgpath, + tree, + has, + depth + 1, + cb) } function doIt (wanted, latest) { @@ -399,7 +393,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { var cFromUrl = curr && curr.from && url.parse(curr.from).protocol if (!curr || - dFromUrl && cFromUrl && m._from !== curr.from || + (dFromUrl && cFromUrl && m._from !== curr.from) || m.version !== curr.version || m.version !== l.version) { doIt(m.version, l.version) |