diff options
author | Kazuhito Hokamura <k.hokamura@gmail.com> | 2015-03-25 07:44:12 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-03-27 11:27:57 +0300 |
commit | 3cf3b0c8fddb6b66f969969feebea85fabd0360b (patch) | |
tree | fd12253f5065197da160bf9e49e2c4f0e6e2ffb2 /lib | |
parent | 402f52ab201efa348feb87cad753fc4b91e8a3fb (diff) |
link: use absolute links when `npm link`ing.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/link.js | 2 | ||||
-rw-r--r-- | lib/utils/link.js | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/link.js b/lib/link.js index 387fb35c3..916ebd6af 100644 --- a/lib/link.js +++ b/lib/link.js @@ -127,7 +127,7 @@ function linkPkg (folder, cb_) { return cb(er) } var target = path.resolve(npm.globalDir, d.name) - symlink(me, target, function (er) { + symlink(me, target, false, true, function (er) { if (er) return cb(er) log.verbose("link", "build target", target) // also install missing dependencies. diff --git a/lib/utils/link.js b/lib/utils/link.js index 9e01d82e6..e353bfae9 100644 --- a/lib/utils/link.js +++ b/lib/utils/link.js @@ -16,13 +16,14 @@ function linkIfExists (from, to, gently, cb) { }) } -function link (from, to, gently, cb) { +function link (from, to, gently, abs, cb) { + if (typeof cb !== "function") cb = abs, abs = false if (typeof cb !== "function") cb = gently, gently = null if (npm.config.get("force")) gently = false to = path.resolve(to) var target = from = path.resolve(from) - if (process.platform !== "win32") { + if (!abs && process.platform !== "win32") { // junctions on windows must be absolute target = path.relative(path.dirname(to), from) // if there is no folder in common, then it will be much |