-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: Allow multiple npm packages to be added at once + tests #2245
Conversation
@return {Promise} | ||
*/ | ||
Blueprint.prototype.addPackagesToProject = function(packages) { | ||
var command = 'npm install --save-dev '; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we not use the npm bundled with ember-cli? (or am i missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only refactored the existing code, I didn't look to see if there was a task we could use instead. I'll re-code after my meeting to take advantage of the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we probably should use the internal npm task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(similar to the bower install method above)
243b016
to
13a3cf4
Compare
Updated the task to use packaged npm, and call with --save-dev. Squashed commits. |
13a3cf4
to
b241f30
Compare
I've un-broken the smoke tests now :) |
Blueprint.prototype.addPackagesToProject = function(packages) { | ||
var task = this.taskFor('npm-install'); | ||
var ui = this.ui; | ||
var install = (packages.length > 1) ? ' install packages' : 'install package'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The truthy part includes a leading space, but the falsey part does not. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, will fix
b241f30
to
cb7bcbe
Compare
nice! |
@@ -18,8 +18,10 @@ module.exports = Task.extend({ | |||
var npmOptions = { | |||
loglevel: options.verbose ? 'verbose' : 'error', | |||
logstream: this.ui.outputStream, | |||
color: 'always' | |||
color: 'always', | |||
'save-dev': (options['save-dev']) ? true : false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'save-dev': !!options['save-dev']
?
cb7bcbe
to
b927a02
Compare
Refactor: Allow multiple npm packages to be added at once + tests
👍 |
npm equivalent of #2222