Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
proper semver, and report folder properly
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 22, 2011
1 parent b04cb44 commit f8546b4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/outdated.js
Expand Up @@ -26,7 +26,7 @@ var readInstalled = require("./utils/read-installed")
, asyncMap = require("./utils/async-map") , asyncMap = require("./utils/async-map")
, npm = require("../npm") , npm = require("../npm")
, log = require("./utils/log") , log = require("./utils/log")
, semver = require("./utils/semver") , semver = require("semver")


// outdated(pref) // outdated(pref)
// deps = pref/package.json dependencies, or {<pref/node_modules/*>:"*"} // deps = pref/package.json dependencies, or {<pref/node_modules/*>:"*"}
Expand All @@ -44,7 +44,9 @@ var readInstalled = require("./utils/read-installed")
var output var output
function outdated (args, silent, cb) { function outdated (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false if (typeof cb !== "function") cb = silent, silent = false
outdated_(npm.prefix, args, function (er, list) { var pref = npm.prefix
if (npm.config.get("global")) pref = path.resolve(pref, "lib")
outdated_(pref, args, function (er, list) {
if (er) return cb(er) if (er) return cb(er)
if (list.length && !silent) { if (list.length && !silent) {
var outList = list.map(function (ww) { var outList = list.map(function (ww) {
Expand All @@ -70,7 +72,9 @@ function outdated_ (prefix, args, cb) {
validateDep(prefix, args, dep, req, function (er, exists, needsUpdate) { validateDep(prefix, args, dep, req, function (er, exists, needsUpdate) {
if (er) return cb(er) if (er) return cb(er)
log([prefix, dep, req, exists, needsUpdate], "outdated_") log([prefix, dep, req, exists, needsUpdate], "outdated_")
if (needsUpdate) return cb(null, [[prefix, dep, exists]]) if (needsUpdate) return cb(null, [[path.resolve(prefix
, "node_modules", dep)
, dep, exists]])
else if (!exists) return cb(null, []) else if (!exists) return cb(null, [])
else outdated_(path.resolve(prefix, "node_modules", dep), args, cb) else outdated_(path.resolve(prefix, "node_modules", dep), args, cb)
}) })
Expand Down

0 comments on commit f8546b4

Please sign in to comment.