Conversation
| require('../install/install').install as typeof installTypeOnly; | ||
|
|
||
| // Use `npm` from the config, if available and not passed as a CLI arg. | ||
| if (options.npm === undefined && config.npm !== undefined) { |
There was a problem hiding this comment.
We should really do this in a unified place
packages/cli/src/install/install.ts
Outdated
| import StandardRenderer = require('bower/lib/renderers/StandardRenderer'); | ||
| import BowerProject = require('bower/lib/core/Project'); | ||
|
|
||
| const exec = util.promisify(child_process.exec); |
There was a problem hiding this comment.
This is sadly not available in node 6, we just aren't running node 6 integration tests currently (see #136)
packages/cli/src/install/install.ts
Outdated
|
|
||
| export async function install(options?: Options): Promise<void> { | ||
| if (options && options.npm) { | ||
| await npmInstall(); |
There was a problem hiding this comment.
Equivalent and simpler: return npmInstall()
rictic
left a comment
There was a problem hiding this comment.
[marking requested changes]
packages/cli/src/install/install.ts
Outdated
| child_process.exec('npm install', {cwd: process.cwd()}, (error, stdout, stderr) => { | ||
| error ? reject(error) : resolve([stdout, stderr]); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
| 'the package name is read from package.json', | ||
| description: 'Sets npm mode: dependencies are installed from npm, ' + | ||
| 'component directory is "node_modules" and the package name is read ' + | ||
| 'from package.json', |
There was a problem hiding this comment.
I'm starting to think that the --npm flag / config option description should be made more generic because it has to match across all commands ("Sets npm mode.") and each command's help description might be a better place to put specific information about how it reacts to the flag.
There was a problem hiding this comment.
Yeah, I think we need to do some unification to the way we handle options/config in the CLI
If the
--npmflag is passed ornpm: trueis set inpolymer.json,polymer installwill runnpm installinstead of installing dependencies from Bower. (fixes #118)