Skip to content

Commit

Permalink
fix: fix indent size being prompted when user selects to use tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Jul 25, 2020
1 parent b6208f6 commit 9b88bf8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export default class BuildGenerator extends BaseGenerator {
this.addPrompt(PromptNames.ScriptName, true);
this.addPrompt(PromptNames.SourceDir, true);
this.addPrompt(PromptNames.UseTabs, true);
this.addPrompt(PromptNames.IndentSize, true);

if (!this.getBoolValue(PromptNames.UseTabs, false)) {
this.addPrompt(PromptNames.IndentSize, true);
}

await this.callPrompts();

Expand Down
7 changes: 6 additions & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ export default class ConfigGenerator extends BaseGenerator {

for (const name of this.promptNames) {
this.addOption(name);
this.addPrompt(name, true);
if (
name !== PromptNames.IndentSize ||
!this.getBoolValue(PromptNames.UseTabs, false)
) {
this.addPrompt(name, true);
}
}

const whenCondition = (answers: Answers) =>
Expand Down
7 changes: 6 additions & 1 deletion src/project/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ export default class ProjectGenerator extends BaseGenerator {
];

for (const name of promptNames) {
this.addPrompt(name, true);
if (
name !== PromptNames.IndentSize ||
!this.getBoolValue(PromptNames.UseTabs, false)
) {
this.addPrompt(name, true);
}
}

return this.callPrompts();
Expand Down

0 comments on commit 9b88bf8

Please sign in to comment.