Skip to content

Commit

Permalink
fix(app): correct duplicate prompting when running app generator
Browse files Browse the repository at this point in the history
Due to an upstream change in yeoman we suddenly started getting prompted twice for each question.
This is happening because we are using a variable with the same name as upstream. This commit
changes that variable to be called something else.

fix #410
  • Loading branch information
AdmiringWorm committed Jul 21, 2020
1 parent 39a00fa commit 1973392
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils/base-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { indentStream } from "./streams/indent-stream";

/** Declares a common base to be used by all of the implemented generators */
export default abstract class BaseGenerator extends Generator {
private _prompts: Generator.Question[] = [];
private _generatorPrompts: Generator.Question[] = [];
private _answers: Generator.Answers = {};
private _overrides: Generator.Answers = {};
private _optionConfigs: IGeneratorOption[] = [];
Expand Down Expand Up @@ -89,7 +89,10 @@ export default abstract class BaseGenerator extends Generator {
// First let us populate the existing answers with available options
this.validateOptions();

this._answers = { ...(await this.prompt(this._prompts)), ...this._answers };
this._answers = {
...(await this.prompt(this._generatorPrompts)),
...this._answers,
};

this.registerTransformStream(
gulpIf(
Expand Down Expand Up @@ -129,7 +132,7 @@ export default abstract class BaseGenerator extends Generator {
return;
}

this._prompts.push(question);
this._generatorPrompts.push(question);
}

protected addOption(question: IGeneratorOption | PromptNames) {
Expand Down

0 comments on commit 1973392

Please sign in to comment.