Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
install: stop special-casing commits after removes
Browse files Browse the repository at this point in the history
And actually, just get rid of the remove commit phase, it's unhelpful as
written.

Credit: @iarna
Reviewed-By: @zkat
PR-URL: #10655
  • Loading branch information
iarna authored and othiym23 committed Dec 3, 2015
1 parent a04ec04 commit 19c626d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 0 additions & 6 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,6 @@ Installer.prototype.executeActions = function (cb) {
[doParallelActions, 'extract', staging, todo, cg.newGroup('extract', 10)],
[doParallelActions, 'preinstall', staging, todo, trackLifecycle.newGroup('preinstall')],
[doReverseSerialActions, 'remove', staging, todo, cg.newGroup('remove')],
// FIXME: We do this here to commit the removes prior to trying to move
// anything into place. Once we can rollback removes we should find
// a better solution for this.
// This is to protect against cruft in the node_modules folder (like dot files)
// that stop it from being removed.
[this, this.commit, staging, this.todo],
[doSerialActions, 'move', staging, todo, cg.newGroup('move')],
[doSerialActions, 'finalize', staging, todo, cg.newGroup('finalize')],
[doSerialActions, 'build', staging, todo, trackLifecycle.newGroup('build')],
Expand Down
8 changes: 3 additions & 5 deletions lib/install/action/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ function removeDir (pkg, log, next) {
rename(path.join(pkg.path, 'node_modules'), modpath, unbuildPackage)

function unbuildPackage (renameEr) {
npm.commands.unbuild(pkg.path, true, renameEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack)
npm.commands.unbuild(pkg.path, true, function () {
rimraf(pkg.path, renameEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack)
})
}

function andRemoveEmptyParents (path) {
Expand Down Expand Up @@ -77,7 +79,3 @@ function removeDir (pkg, log, next) {
})
}
}

module.exports.commit = function (staging, pkg, next) {
rimraf(pkg.path, next)
}

0 comments on commit 19c626d

Please sign in to comment.