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
path: root/lib
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2017-05-10 23:27:14 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:13 +0300
commitd3dc69b6a2620c58e2bf41a3ccc0b024677484ce (patch)
tree5d256d26da27f517d2f18f0f4696d2245f0a3396 /lib
parent3d8e8de1a7fcf01ea79ae59b574407f7b0b26d49 (diff)
finalize: Don't nuke symlink destinations pls
Diffstat (limited to 'lib')
-rw-r--r--lib/install/action/finalize.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/install/action/finalize.js b/lib/install/action/finalize.js
index 8e1fc9253..a68f7b31f 100644
--- a/lib/install/action/finalize.js
+++ b/lib/install/action/finalize.js
@@ -95,5 +95,8 @@ module.exports = function (staging, pkg, log) {
}
module.exports.rollback = function (top, staging, pkg, next) {
- gentlyRm(pkg.realpath, false, top, next)
+ const requested = pkg.package._requested || getRequested(pkg)
+ if (requested.type !== 'directory') {
+ gentlyRm(pkg.realpath, false, top, next)
+ }
}