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-24 14:07:59 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:28 +0300
commit864a4d9a9e9bffc37e6ba927036637939e703a49 (patch)
treebc229abd016aea14ad26ce1a12a71ccbcd45d2e5 /lib
parentaf92d17a7f2119dbf0f356ea4424fa45c2d4a7b4 (diff)
finalize: Make symlinks relative when possible
Diffstat (limited to 'lib')
-rw-r--r--lib/install/action/finalize.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/install/action/finalize.js b/lib/install/action/finalize.js
index 1e8647571..ba38e602f 100644
--- a/lib/install/action/finalize.js
+++ b/lib/install/action/finalize.js
@@ -23,10 +23,11 @@ module.exports = function (staging, pkg, log) {
const requested = pkg.package._requested || getRequested(pkg)
if (requested.type === 'directory') {
+ const relative = path.relative(path.dirname(pkg.path), pkg.realpath)
return makeParentPath(pkg.path)
- .then(() => symlink(pkg.realpath, pkg.path, 'junction'))
+ .then(() => symlink(relative, pkg.path, 'junction'))
.catch((ex) => {
- return rimraf(pkg.path).then(() => symlink(pkg.realpath, pkg.path, 'junction'))
+ return rimraf(pkg.path).then(() => symlink(relative, pkg.path, 'junction'))
})
} else {
return makeParentPath(pkg.realpath)