aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/lib/outdated.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/outdated.js')
-rw-r--r--deps/npm/lib/outdated.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js
index 197b719625..bb4c346f9a 100644
--- a/deps/npm/lib/outdated.js
+++ b/deps/npm/lib/outdated.js
@@ -101,7 +101,10 @@ function outdated (args, silent, cb) {
return aa[0].path.localeCompare(bb[0].path) ||
aa[1].localeCompare(bb[1])
})
- if (er || silent || list.length === 0) return cb(er, list)
+ if (er || silent ||
+ (list.length === 0 && !opts.json)) {
+ return cb(er, list)
+ }
if (opts.json) {
output(makeJSON(list, opts))
} else if (opts.parseable) {
@@ -129,7 +132,7 @@ function outdated (args, silent, cb) {
}
output(table(outTable, tableOpts))
}
- process.exitCode = 1
+ process.exitCode = list.length ? 1 : 0
cb(null, list.map(function (item) { return [item[0].parent.path].concat(item.slice(1, 7)) }))
})
}))
@@ -149,7 +152,7 @@ function makePretty (p, opts) {
has || 'MISSING',
want,
latest,
- deppath
+ deppath || 'global'
]
if (long) {
columns[5] = type
@@ -366,6 +369,8 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, opts, cb, type
return doIt('git', 'git')
} else if (parsed.type === 'file') {
return updateLocalDeps()
+ } else if (parsed.type === 'remote') {
+ return doIt('remote', 'remote')
} else {
return packument(parsed, opts.concat({
'prefer-online': true