Browse files

Remove global bin symlinks properly

  • Loading branch information...
1 parent 9acf643 commit 21f17714c0955354c345d080f6d5ac43baadba48 @isaacs isaacs committed Apr 23, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/unbuild.js
View
3 lib/unbuild.js
@@ -36,7 +36,7 @@ function rmStuff (pkg, folder, cb) {
// then bins are in {prefix}/bin
// otherwise, then bins are in folder/../.bin
var parent = path.dirname(folder)
- , gnm = path.resolve(npm.config.get("prefix"), "node_modules")
+ , gnm = path.resolve(npm.config.get("prefix"), "lib", "node_modules")
, top = gnm === parent
log.verbose([top, gnm, parent], "unbuild "+pkg._id)
@@ -49,6 +49,7 @@ function rmBins (pkg, folder, parent, top, cb) {
if (!pkg.bin) return cb()
var binRoot = top ? path.resolve(npm.config.get("prefix"), "bin")
: path.resolve(parent, ".bin")
+ log.warn([binRoot, pkg.bin], "binRoot")
asyncMap(Object.keys(pkg.bin), function (b, cb) {
rm(path.resolve(binRoot, b), folder, cb)
}, cb)

0 comments on commit 21f1771

Please sign in to comment.