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,