Expose require('pnpm.js')

This commit is contained in:
Rico Sta. Cruz committed 2016-02-02 01:23:38 +08:00
1 parent a0ff75dcd3
commit 2d7050fab4
3 files changed
+14 -4

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
var pnpm = {}
Object.defineProperty(pnpm, 'install', {
enumerable: true,
get: function () {
return require('./lib/cmd/install')
}
})
module.exports = pnpm
+1 -1
View File
@@ -21,7 +21,7 @@ function installCmd (input, flags) {
var pkg
var packagesToInstall
var installType
var isProductionInstall = cli.flags.production || process.env.NODE_ENV === 'production'
var isProductionInstall = flags.production || process.env.NODE_ENV === 'production'
return readPkgUp()
.then(_ => { pkg = _ })
+3 -3
View File
@@ -3,7 +3,7 @@ var join = require('path').join
var fs = require('fs')
var prepare = require('./support/prepare')
var basicPackageJson = require('./support/simple-package.json')
var install = require('../lib/cmd/install')
var install = require('../index').install
require('./support/sepia')
var stat, _
@@ -249,7 +249,7 @@ test('production install (with --production flag)', function (t) {
prepare()
fs.writeFileSync('package.json', JSON.stringify(basicPackageJson), 'utf-8')
return install({ input: [], flags: { quiet: true, production: true } })
return install([], { quiet: true, production: true })
.then(function () {
var rimrafDir = fs.statSync(join(process.cwd(), 'node_modules', 'rimraf'))
@@ -271,7 +271,7 @@ test('production install (with production NODE_ENV)', function (t) {
prepare()
fs.writeFileSync('package.json', JSON.stringify(basicPackageJson), 'utf-8')
return install({ input: [], flags: { quiet: true } })
return install([], { quiet: true })
.then(function () {
// reset NODE_ENV
process.env.NODE_ENV = originalNODE_ENV