Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-02-18 01:00:49 +0300
committerisaacs <i@izs.me>2011-02-18 01:00:49 +0300
commit0abdf47d3724604b276eb4989b225fd7fbe60585 (patch)
treec3a5123744fba33bb5c83398e154567440b2209b
parenta3f6536d0249a68a437ae1b766db67c655ad83b8 (diff)
Only rebuild things in the bundle that are visible
-rw-r--r--lib/build.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/build.js b/lib/build.js
index 5044c3cae..d60d9d293 100644
--- a/lib/build.js
+++ b/lib/build.js
@@ -67,14 +67,19 @@ function rebuildBundle (pkg, cb) {
if (!npm.config.get("rebuild-bundle")) return cb()
var bundle = path.join( npm.dir, pkg.name, pkg.version
, "package", "node_modules")
- fs.stat(bundle, function (er, s) {
- if (er || !s.isDirectory()) return cb()
+ fs.readdir(bundle, function (er, files) {
+ if (er) return cb()
+ files = files.filter(function (f) {
+ return -1 !== f.indexOf("@") && f.charAt(0) !== "."
+ })
+ if (!files.length) return cb()
+ log.warn(files, "bundled things")
log(pkg._id, "rebuilding bundled dependencies")
conf.unshift({ root : bundle
, binroot : null
, manroot : null
})
- npm.commands.rebuild([], function (er, data) {
+ npm.commands.rebuild(files, function (er, data) {
conf.shift()
cb(er, data)
})