aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/lib/install.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/install.js')
-rw-r--r--deps/npm/lib/install.js34
1 files changed, 10 insertions, 24 deletions
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index 4c3d0def78..0cf6a2b2d6 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -208,7 +208,6 @@ function Installer (where, dryrun, args) {
this.progress = {}
this.noPackageJsonOk = !!args.length
this.topLevelLifecycles = !args.length
- this.npat = npm.config.get('npat')
this.dev = npm.config.get('dev') || (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || /^dev(elopment)?$/.test(npm.config.get('only'))
this.prod = !/^dev(elopment)?$/.test(npm.config.get('only'))
this.rollback = npm.config.get('rollback')
@@ -485,10 +484,6 @@ Installer.prototype.executeActions = function (cb) {
[doParallelActions, 'update-linked', staging, todo, trackLifecycle.newGroup('update-linked')],
[doSerialActions, 'install', staging, todo, trackLifecycle.newGroup('install')],
[doSerialActions, 'postinstall', staging, todo, trackLifecycle.newGroup('postinstall')])
- if (this.npat) {
- steps.push(
- [doParallelActions, 'test', staging, todo, trackLifecycle.newGroup('npat')])
- }
var self = this
chain(steps, function (er) {
@@ -507,9 +502,10 @@ Installer.prototype.rollbackFailedOptional = function (staging, actionsToRun, cb
}).filter(function (pkg) {
return pkg.failed && pkg.rollback
})
+ var top = this.currentTree.path
asyncMap(failed, function (pkg, next) {
asyncMap(pkg.rollback, function (rollback, done) {
- rollback(staging, pkg, done)
+ rollback(top, staging, pkg, done)
}, next)
}, cb)
}
@@ -552,13 +548,9 @@ Installer.prototype.runPostinstallTopLevelLifecycles = function (cb) {
[doOneAction, 'build', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('build:.')],
[doOneAction, 'install', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('install:.')],
[doOneAction, 'postinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('postinstall:.')])
- if (this.npat) {
- steps.push(
- [doOneAction, 'test', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('npat:.')])
- }
if (this.dev) {
steps.push(
- [doOneAction, 'prepublish', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('prepublish')])
+ [doOneAction, 'prepare', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('prepare')])
}
chain(steps, cb)
}
@@ -607,19 +599,13 @@ Installer.prototype.readLocalPackageData = function (cb) {
return cb(er)
}
if (!currentTree.package) currentTree.package = {}
- if (currentTree.package._shrinkwrap) {
- self.loadArgMetadata(cb)
- } else {
- fs.readFile(path.join(self.where, 'npm-shrinkwrap.json'), function (er, data) {
- if (er) return self.loadArgMetadata(cb)
- try {
- currentTree.package._shrinkwrap = parseJSON(data)
- } catch (ex) {
- return cb(ex)
- }
- return self.loadArgMetadata(cb)
- })
- }
+ readShrinkwrap(currentTree, function (err) {
+ if (err) {
+ cb(err)
+ } else {
+ self.loadArgMetadata(cb)
+ }
+ })
}))
}))
}