Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class DotnetProjectCreateStep extends ProjectCreateStepBase {
templateArgs.Framework = context.workerRuntime.targetFramework;
}

await executeDotnetTemplateCreate(context, version, projTemplateKey, context.projectPath, identity, templateArgs);
await executeDotnetTemplateCreate(context, version, projTemplateKey, context.projectPath, identity, templateArgs, { force: true });

await setLocalAppSetting(context, context.projectPath, ConnectionKey.Storage, '', MismatchBehavior.Overwrite);
}
Expand Down
4 changes: 3 additions & 1 deletion src/templates/dotnet/executeDotnetTemplateCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { randomUtils, type IActionContext } from '@microsoft/vscode-azext-utils';
import { composeArgs, withArg, withNamedArg, withQuotedArg } from '@microsoft/vscode-processutils';
import { composeArgs, withArg, withFlagArg, withNamedArg, withQuotedArg } from '@microsoft/vscode-processutils';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
Expand Down Expand Up @@ -59,6 +59,7 @@ export async function executeDotnetTemplateCreate(
workingDirectory: string | undefined,
identity: string,
templateArgs: Record<string, string>,
options?: { force?: boolean },
): Promise<void> {
const templateDir = getDotnetTemplateDir(context, version, projTemplateKey);
const itemNupkg = path.join(templateDir, itemNupkgFileName);
Expand Down Expand Up @@ -102,6 +103,7 @@ export async function executeDotnetTemplateCreate(
...Object.entries(templateArgs)
.filter(([, value]) => value !== undefined && value !== '')
.map(([key, value]) => withNamedArg(`--${key}`, value, { shouldQuote: true })),
withFlagArg('--force', options?.force),
)();

await cpUtils.executeCommand(
Expand Down
Loading