Fix binstubs for bundled dependencies

This commit is contained in:
Rico Sta. Cruz committed 2016-01-31 01:52:21 +08:00
1 parent a99278b8c3
commit 92e5cb9b0b
3 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -187,8 +187,8 @@ function buildInStore (ctx, paths, pkg, log) {
.then(_ => log('package.json', fulldata))
// link node_modules/.bin
.then(_ => linkBins(paths.modules, paths.tmp, paths.target))
.then(_ => linkBundledDeps(paths.tmp))
.then(_ => linkBins(paths.modules, join(paths.tmp, '_'), join(paths.target, '_')))
.then(_ => linkBundledDeps(join(paths.tmp, '_')))
// recurse down to dependencies
.then(_ => log('dependencies'))
+4 -4
View File
@@ -20,7 +20,7 @@ var debug = require('debug')('pnpm:link_bins')
*/
module.exports = function linkBins (modules, target, finalTarget) {
var pkg = tryRequire(join(target, '_', 'package.json'))
var pkg = tryRequire(join(target, 'package.json'))
if (!pkg || !pkg.bin) return
var bins = binify(pkg)
@@ -29,13 +29,13 @@ module.exports = function linkBins (modules, target, finalTarget) {
var actualBin = bins[bin]
return Promise.resolve()
.then(_ => fs.chmod(join(target, '_', actualBin), 0o755))
.then(_ => fs.chmod(join(target, actualBin), 0o755))
.then(_ => mkdirp(join(modules, '.bin')))
.then(_ => debug('linking %s -> %s',
join(finalTarget, '_', actualBin),
join(finalTarget, actualBin),
join(modules, '.bin', bin)))
.then(_ => relSymlink(
join(finalTarget, '_', actualBin),
join(finalTarget, actualBin),
join(modules, '.bin', bin)))
})
}
+1 -1
View File
@@ -4,7 +4,7 @@ var join = require('path').join
var linkBins = require('./link_bins')
module.exports = function linkBundledDeps (root) {
var nodeModules = join(root, '_', 'node_modules')
var nodeModules = join(root, 'node_modules')
return isDir(nodeModules, _ =>
Promise.all(fs.readdir(nodeModules).map(mod =>