Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
18 changes: 12 additions & 6 deletions packages/cli/src/command-implementations/deploy-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export class DeployCommand extends ProjectCommand<DeployCommandDefinition> {
}

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)
Expand Down Expand Up @@ -502,10 +504,13 @@ export class DeployCommand extends ProjectCommand<DeployCommandDefinition> {
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')
Expand Down Expand Up @@ -551,7 +556,8 @@ export class DeployCommand extends ProjectCommand<DeployCommandDefinition> {
`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 }) }
Expand Down
Loading