From 486e97b9a81d2d59afee40694f631c9ce5554308 Mon Sep 17 00:00:00 2001 From: Nathaniel Girard <72364963+Nathaniel-Girard@users.noreply.github.com> Date: Wed, 30 Jul 2025 15:45:47 -0400 Subject: [PATCH] fix(cli): fixed prompt error message on deploy (#14090) --- packages/cli/package.json | 2 +- .../command-implementations/deploy-command.ts | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index d2de44109a3..e2309695a17 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@botpress/cli", - "version": "4.14.0", + "version": "4.14.1", "description": "Botpress CLI", "scripts": { "build": "pnpm run bundle && pnpm run template:gen", diff --git a/packages/cli/src/command-implementations/deploy-command.ts b/packages/cli/src/command-implementations/deploy-command.ts index 1e380ede63e..66a5d450323 100644 --- a/packages/cli/src/command-implementations/deploy-command.ts +++ b/packages/cli/src/command-implementations/deploy-command.ts @@ -55,7 +55,9 @@ export class DeployCommand extends ProjectCommand { } private async _deployIntegration(api: apiUtils.ApiClient, integrationDef: sdk.IntegrationDefinition) { - const { integration: updatedIntegrationDef, workspaceId } = await this._manageWorkspaceHandle(api, integrationDef) + const res = await this._manageWorkspaceHandle(api, integrationDef) + if (!res) return + const { integration: updatedIntegrationDef, workspaceId } = res integrationDef = updatedIntegrationDef if (workspaceId) { api = api.switchWorkspace(workspaceId) @@ -502,10 +504,13 @@ export class DeployCommand extends ProjectCommand { private async _manageWorkspaceHandle( api: apiUtils.ApiClient, integration: sdk.IntegrationDefinition - ): Promise<{ - integration: sdk.IntegrationDefinition - workspaceId?: string // Set if user opted to deploy on another available workspace - }> { + ): Promise< + | { + integration: sdk.IntegrationDefinition + workspaceId?: string // Set if user opted to deploy on another available workspace + } + | undefined + > { const { name: localName, workspaceHandle: localHandle } = this._parseIntegrationName(integration.name) if (!localHandle && api.isBotpressWorkspace) { this.logger.debug('Botpress workspace detected; workspace handle omitted') @@ -551,7 +556,8 @@ export class DeployCommand extends ProjectCommand { `Your current workspace handle is "${remoteHandle}". Do you want to use the name "${remoteHandle}/${localName}"?` ) if (!confirmAddHandle) { - throw new errors.BotpressCLIError(workspaceHandleIsMandatoryMsg) + this.logger.log('Aborted') + return } const newName = `${remoteHandle}/${localName}` return { integration: new sdk.IntegrationDefinition({ ...integration, name: newName }) }