Skip to content

Commit

Permalink
Add new optional argument to create .net7 project
Browse files Browse the repository at this point in the history
  • Loading branch information
nturinski committed Aug 3, 2022
1 parent c27703a commit ebe5fdf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ export class DotnetProjectCreateStep extends ProjectCreateStepBase {
}
const functionsVersion: string = 'v' + majorVersion;
const projTemplateKey = nonNullProp(context, 'projectTemplateKey');
await executeDotnetTemplateCommand(context, version, projTemplateKey, context.projectPath, 'create', '--identity', identity, '--arg:name', cpUtils.wrapArgInQuotes(projectName), '--arg:AzureFunctionsVersion', functionsVersion);
const args = ['--identity', identity, '--arg:name', cpUtils.wrapArgInQuotes(projectName), '--arg:AzureFunctionsVersion', functionsVersion];
if (/net7.[0-9]/.test(projTemplateKey)) {
args.push('--arg:Framework', cpUtils.wrapArgInQuotes('net7.0'));
}

await executeDotnetTemplateCommand(context, version, projTemplateKey, context.projectPath, 'create', ...args);

await setLocalAppSetting(context, context.projectPath, azureWebJobsStorageKey, '', MismatchBehavior.Overwrite);
}
Expand Down

0 comments on commit ebe5fdf

Please sign in to comment.