Open FrancoisDF opened 6 years ago
Starting from yeoman-generator@v0.23.0, Base#prompt()
functions now returns a promise instead of taking a callback parameter:
prompting: function () {
return this.prompt(questions).then(function (answers) {
this.answers = answers;
}.bind(this));
}
So I think the adapter need to be updated to use a promise instead of a callback. Or maybe returning both to be compatible with more generators.
FIX
In yo/adapter.js
ProcessAdapter.prototype.prompt = function (questions, callback) {
process.send({
event: 'generator:prompt-questions',
data: questions
});
if (callback){
this.answerCallback = callback;
} else {
return new Promise((resolve) => {
this.answerCallback = resolve;
});
}
};
@R0muald do you want to send a PR?
This project isn't actively maintained anymore, but I'll gladly help you get some fixes in.
I could not get any generators working that were using yeoman-generator@^1.0.0. I keep getting the following error:
(generator-licence is an easy one to test)