Skip to content

Commit

Permalink
feat: option for Alloy/Classic project creation
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Oct 30, 2023
1 parent 2c6016a commit 2f2d152
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/commands/createApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { handleInteractionError, InteractionError } from './common';
export async function createApplication (): Promise<void> {
try {
let force = false;
let alloy = true;
const logLevel = ExtensionContainer.config.general.logLevel;
const lastCreationPath = ExtensionContainer.context.workspaceState.get<string>(WorkspaceState.LastCreationPath);

Expand Down Expand Up @@ -47,12 +48,16 @@ export async function createApplication (): Promise<void> {
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;
});

Expand Down

0 comments on commit 2f2d152

Please sign in to comment.