-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use grunt-bower-install for HTML dependency injection. #497
Conversation
❤️ it! Tested it briefly and it worked flawlessly. |
this.installDependencies({ skipInstall: this.options['skip-install'] }); | ||
this.installDependencies({ | ||
skipInstall: this.options['skip-install'], | ||
callback: function () { |
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.
does callback get called if this.options['skip-install'] is 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.
Good point! I re-factored a bit.
LGTM and testing works. Could we also get a few users trying this out before we land it? |
I've implemented this method on my ngbp generator and everything works fine. But, I can not see the information message when the user passes the flag Le source: https://github.com/kevin-wolf/generator-ngbp/blob/master/app/index.js Any thoughts? |
👍 |
}); | ||
|
||
this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json'))); | ||
this.pkg = require(__dirname, '../package.json'); |
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.
this.pkg = require('../package.json');
Haha. My question was; did you know why the function isn't calling when the user adds the |
i keep meaning to get to this and i should be able to today or tomorrow |
@eddiemonge Awesome! :) |
made a couple of small tweaks and landed it |
fix(gen): use bool for bootstrap filters
To sync up the generators, I added
grunt-bower-install
here. It definitely needs to be tested, and my computer is in a 💩-y state for that. So, I thought I'd see if anyone here had a chance.It turns out this isn't only nice for users, who will be able to inject dependencies automatically, but it's also created for some easier generator authoring. Less JS ifs, and more "let
grunt-bower-installwiredep handle it."I attached aspawnCommand('grunt', ['bower-install'])
callback after the scaffold finishes installing the NPM and Bower dependencies. Not sure if that's a good idea, best practice wise, but it works!