Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a 'rollback' boolean config to prevent rolling back failed installs

  • Loading branch information...
commit 5bc325b3ec4e326ed83cce5c5aa8b8e138c91374 1 parent b51e5a0
@isaacs isaacs authored
View
5 lib/install.js
@@ -326,6 +326,11 @@ function rollbackFailure (installList, cb) { return function (er) {
})
npm.ROLLBACK = true
log.error(er, "install failed")
+
+ if (!npm.config.get("rollback")) {
+ return cb(er)
+ }
+
log("rollback", "install failed")
log(installList, "uninstall")
return npm.commands.uninstall
View
2  lib/link.js
@@ -106,7 +106,7 @@ function doLink (data, folder, deps, cb) {
, [ symlink, folder, pkgDir ]
, [ npm.commands, "build", [data] ]
, function (er) {
- if (!er) return cb()
+ if (!er || !npm.config.get("rollback")) return cb(er)
// error, rollback
npm.ROLLBACK = true
log.error(er, "error linking, rollback")
View
1  lib/utils/default-config.js
@@ -43,6 +43,7 @@ module.exports =
, "rebuild-bundle" : true
, recursive : false
, registry : "http://registry.npmjs.org/"
+ , rollback : true
, root : path.join(process.execPath, "..", "..", "lib", "node")
, tag : "latest"
, tar : process.env.TAR || "tar"
View
1  lib/utils/parse-args.js
@@ -44,6 +44,7 @@ exports.types =
, "rebuild-bundle" : Boolean
, recursive : Boolean
, registry : url
+ , rollback : Boolean
, root : path
, tag : String
, tar : String
Please sign in to comment.
Something went wrong with that request. Please try again.