diff --git a/src/Aspire.Cli/Projects/GuestAppHostProject.cs b/src/Aspire.Cli/Projects/GuestAppHostProject.cs index 778a20ba35d..9f0f2b9f5e1 100644 --- a/src/Aspire.Cli/Projects/GuestAppHostProject.cs +++ b/src/Aspire.Cli/Projects/GuestAppHostProject.cs @@ -274,8 +274,8 @@ await GenerateCodeViaRpcAsync( cancellationToken); // Step 5: Install dependencies using GuestRuntime (best effort - don't block code generation) - await InstallDependenciesAsync(directory, rpcClient, cancellationToken); - return true; + var result = await InstallDependenciesAsync(directory, rpcClient, cancellationToken); + return (result == 0); } finally { diff --git a/src/Aspire.Cli/Templating/CliTemplateFactory.TypeScriptStarterTemplate.cs b/src/Aspire.Cli/Templating/CliTemplateFactory.TypeScriptStarterTemplate.cs index f910e0c21e3..087bd48f1ce 100644 --- a/src/Aspire.Cli/Templating/CliTemplateFactory.TypeScriptStarterTemplate.cs +++ b/src/Aspire.Cli/Templating/CliTemplateFactory.TypeScriptStarterTemplate.cs @@ -76,6 +76,10 @@ private async Task ApplyTypeScriptStarterTemplateAsync(CallbackT if (appHostProject is not IGuestAppHostSdkGenerator guestProject) { _interactionService.DisplayError("Automatic 'aspire restore' is unavailable for the new TypeScript starter project because no TypeScript AppHost SDK generator was found."); + if (Directory.Exists(outputPath)) + { + Directory.Delete(outputPath, true); + } return new TemplateResult(ExitCodeConstants.FailedToBuildArtifacts, outputPath); }