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:
-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)
})