Skip to content

Commit

Permalink
Set templateSchemaVersion regardless if prompt is skipped (#4295)
Browse files Browse the repository at this point in the history
  • Loading branch information
nturinski authored Oct 7, 2024
1 parent d38ea09 commit 1b330f5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/commands/createNewProject/NewProjectLanguageStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ export class NewProjectLanguageStep extends AzureWizardPromptStep<IProjectWizard
throw new UserCancelledError('viewSampleProjects');
} else {
context.language = result.language;
// TODO: Probably should include a ProgrammingModelStep for all languages and set there. but for now we know if it's not Python, there's no way it'll be v2
if (result.language !== ProjectLanguage.Python) {
context.templateSchemaVersion = TemplateSchemaVersion.v1;
}
this.setTemplateSchemaVersion(context);
}
}

public shouldPrompt(context: IProjectWizardContext): boolean {
this.setTemplateSchemaVersion(context);
return context.language === undefined;
}

Expand Down Expand Up @@ -145,4 +143,11 @@ export class NewProjectLanguageStep extends AzureWizardPromptStep<IProjectWizard

return wizardOptions;
}

private setTemplateSchemaVersion(context: IProjectWizardContext): void {
// TODO: Probably should include a ProgrammingModelStep for all languages and set there. but for now we know if it's not Python, there's no way it'll be v2
if (context.language && context.language !== ProjectLanguage.Python) {
context.templateSchemaVersion = TemplateSchemaVersion.v1;
}
}
}

0 comments on commit 1b330f5

Please sign in to comment.