I'm triyng to perform a async callback in my action after the bowerInstall method is completed (the problem is the same with others methods using exec commands). I need this because without it the next action will be triggered before the method is completed.
_-----_
| | .--------------------------.
|--(o)--| | Yeoman is frustrated |
`---------´ | Help him please! |
( _´U`_ ) '--------------------------'
/___A___\
| ~ |
__'.___.'__
´ ` |° ´ Y `
The issue is Yeoman doesn't support async callback situated in method callback.
default: {
installPackage: function () {
done = this.async();
this.bowerInstall(this.packageName, function () {
done();
});
},
nextAction: function () {
// Do stuff after installPackage is completed.
}
}
In this case, the bowerInstall method is never triggered and the run loop breaks.
[EDIT] SOLUTION
Like Simon Boudrias said, I can't use an async callback in the install context. I have to put the tasks I want to run after the install in the end context.
install: {
installPackage: function () {
this.bowerInstall(this.packageName);
}
},
end: {
nextAction: function () {
// Do stuff after installPackage is completed.
}
}
Yeoman installation methods are automatically scheduled during the install task loop.
By using this.async() here, you're deadlocking the process.
This change was documented on the v0.18.0 release. Might be worth it to detail that behavior more explicitly on the install methods documentation -> https://github.com/yeoman/yeoman.io/blob/master/app/authoring/dependencies.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With