From 8559fdf19c9411e2ff0e2ae725a7ff8c3f2a43d0 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Wed, 26 Jul 2023 10:47:05 -0400 Subject: [PATCH] Add option to delete dev channel before install --- src/LaunchConfiguration.ts | 6 ++++++ src/debugSession/BrightScriptDebugSession.ts | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/LaunchConfiguration.ts b/src/LaunchConfiguration.ts index 8c775b51..fe5abfb4 100644 --- a/src/LaunchConfiguration.ts +++ b/src/LaunchConfiguration.ts @@ -260,6 +260,12 @@ export interface LaunchConfiguration extends DebugProtocol.LaunchRequestArgument * @default true */ rendezvousTracking: boolean; + + /** + * Delete any currently installed dev channel before starting the debug session + * @default false + */ + deleteDevChannelBeforeInstall: boolean; } export interface ComponentLibraryConfiguration { diff --git a/src/debugSession/BrightScriptDebugSession.ts b/src/debugSession/BrightScriptDebugSession.ts index 69c999d8..dbdfad0f 100644 --- a/src/debugSession/BrightScriptDebugSession.ts +++ b/src/debugSession/BrightScriptDebugSession.ts @@ -489,6 +489,14 @@ export class BrightScriptDebugSession extends BaseDebugSession { this.logger.log('Uploading zip'); const start = Date.now(); let packageIsPublished = false; + + //delete any currently installed dev channel (if enabled to do so) + if (this.launchConfiguration.deleteDevChannelBeforeInstall === true) { + await this.rokuDeploy.deleteInstalledChannel({ + ...this.launchConfiguration + } as any as RokuDeployOptions); + } + //publish the package to the target Roku const publishPromise = this.rokuDeploy.publish({ ...this.launchConfiguration,