Skip to content
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

Merged
merged 1 commit into from Oct 7, 2014

Conversation

peterchoo
Copy link
Contributor

npm equivalent of #2222

@return {Promise}
*/
Blueprint.prototype.addPackagesToProject = function(packages) {
var command = 'npm install --save-dev ';
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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)

@peterchoo
Copy link
Contributor Author

Updated the task to use packaged npm, and call with --save-dev. Squashed commits.

@peterchoo
Copy link
Contributor Author

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';
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, will fix

@stefanpenner
Copy link
Contributor

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
Copy link
Member

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'] ?

rwjblue added a commit that referenced this pull request Oct 7, 2014
Refactor: Allow multiple npm packages to be added at once + tests
@rwjblue rwjblue merged commit 0c64993 into ember-cli:master Oct 7, 2014
@stefanpenner
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants