From 2f2d1525a2667461101d34ef382e7312fe547fc2 Mon Sep 17 00:00:00 2001 From: m1ga Date: Mon, 30 Oct 2023 10:42:49 +0100 Subject: [PATCH] feat: option for Alloy/Classic project creation --- src/commands/createApp.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/commands/createApp.ts b/src/commands/createApp.ts index eb743edae..de57ad66c 100644 --- a/src/commands/createApp.ts +++ b/src/commands/createApp.ts @@ -12,6 +12,7 @@ import { handleInteractionError, InteractionError } from './common'; export async function createApplication (): Promise { try { let force = false; + let alloy = true; const logLevel = ExtensionContainer.config.general.logLevel; const lastCreationPath = ExtensionContainer.context.workspaceState.get(WorkspaceState.LastCreationPath); @@ -47,12 +48,16 @@ export async function createApplication (): Promise { await window.withProgress({ cancellable: false, location: ProgressLocation.Notification }, async (progress) => { progress.report({ message: l10n.t('Creating application') }); await ExtensionContainer.terminal.runInBackground('ti', args); - progress.report({ message: l10n.t('Creating Alloy project') }); - const alloyArgs = [ 'new' ]; - if (force) { - alloyArgs.push('--force'); + + alloy = await yesNoQuestion({ placeHolder: l10n.t('Create an Alloy project?') }, true); + if (alloy) { + progress.report({ message: l10n.t('Creating Alloy project') }); + const alloyArgs = [ 'new' ]; + if (force) { + alloyArgs.push('--force'); + } + await ExtensionContainer.terminal.runInBackground('alloy', [ 'new' ], { cwd: path.join(workspaceDir.fsPath, name) }); } - await ExtensionContainer.terminal.runInBackground('alloy', [ 'new' ], { cwd: path.join(workspaceDir.fsPath, name) }); return; });