Merge pull request #64 from rstacruz/windows-junctions

Windows support
This commit is contained in:
Rico Sta. Cruz
2016-02-01 20:17:26 +08:00
3 changed files with 6 additions and 3 deletions

View File

@@ -12,6 +12,7 @@
- [ ] git-hosted packages (`npm i rstacruz/scourjs`)
- [ ] optional dependencies (`npm i escodegen@1.8.0` wants `source-map@~0.2.0`)
- [ ] file packages (`npm i file:../path`)
- [x] windows support
- [x] bin executables
- [ ] `--global` installs
- [x] `--save` (et al)

View File

@@ -31,7 +31,6 @@ On the other hand, pnpm manages `node_modules` as an addressable storage in its
## Limitations
- Windows is [not fully supported](https://github.com/rstacruz/pnpm/issues/6) (yet).
- You can't install from [shrinkwrap][] (yet).
- Peer dependencies are a little trickier to deal with.
- You can't publish npm modules with `bundleDependencies` managed by pnpm.

View File

@@ -7,6 +7,9 @@ var relative = require('path').relative
*/
module.exports = function relSymlink (src, dest) {
var rel = relative(dirname(dest), src)
return symlink(rel, dest)
// Turn it into a relative path when not in win32.
var isWindows = process.platform === 'win32'
var rel = isWindows ? src : relative(dirname(dest), src)
return symlink(rel, dest, 'junction')
}