Skip to content

Commit

Permalink
return uninstall module warning on npm uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
gradus committed Mar 30, 2012
1 parent 58c77b8 commit ed529e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/uninstall.js
Expand Up @@ -39,6 +39,7 @@ function uninstall (args, cb) {
}

function uninstall_ (args, nm, cb) {
var o = uninstallOutput(args, nm)
asyncMap(args, function (arg, cb) {
// uninstall .. should not delete /usr/local/lib/node_modules/..
var p = path.join(path.resolve(nm), path.join("/", arg))
Expand All @@ -51,10 +52,17 @@ function uninstall_ (args, nm, cb) {
log.warn(arg, "Not installed in "+nm)
return cb(null, [])
}
cb(null, p)
cb(null, p, o)
})
}, function (er, folders) {
if (er) return cb(er)
asyncMap(folders, npm.commands.unbuild, cb)
})
}

function uninstallOutput (args, nm) {
for (var i = 0; i < args.length; i++) {
var p = path.join(path.resolve(nm), path.join("/", args[i]))
log.warn(p, "uninstalling")
}
}

0 comments on commit ed529e2

Please sign in to comment.