Skip to content

Commit

Permalink
Sill fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed Feb 21, 2024
1 parent c781939 commit 00b0a63
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions src/debugSession/BrightScriptDebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export class BrightScriptDebugSession extends BaseDebugSession {

public async launchRequest(response: DebugProtocol.LaunchResponse, config: LaunchConfiguration) {
this.logger.log('[launchRequest] begin');

//send the response right away so the UI immediately shows the debugger toolbar
this.sendResponse(response);

Expand Down Expand Up @@ -318,15 +319,15 @@ export class BrightScriptDebugSession extends BaseDebugSession {
util.log(`Connecting to Roku via telnet at ${this.launchConfiguration.host}:${this.launchConfiguration.brightScriptConsolePort}`);
}

await this.initRendezvousTracking();
// await this.initRendezvousTracking();

this.createRokuAdapter(this.rendezvousTracker);
await this.connectRokuAdapter();

await this.runAutomaticSceneGraphCommands(this.launchConfiguration.autoRunSgDebugCommands);
// await this.runAutomaticSceneGraphCommands(this.launchConfiguration.autoRunSgDebugCommands);

//press the home button to ensure we're at the home screen
await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);
// await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);

//pass the log level down thought the adapter to the RendezvousTracker and ChanperfTracker
this.rokuAdapter.setConsoleOutput(this.launchConfiguration.consoleOutput);
Expand Down Expand Up @@ -381,7 +382,8 @@ export class BrightScriptDebugSession extends BaseDebugSession {
}
});

await this.publish();
this.logger.log('[launchRequest]', 'DISABLING PUBLISH');
// await this.publish();

this.sendEvent(new ChannelPublishedEvent(
this.launchConfiguration
Expand Down Expand Up @@ -426,7 +428,7 @@ export class BrightScriptDebugSession extends BaseDebugSession {
//if we are at a breakpoint, continue
await this.rokuAdapter.continue();
//kill the app on the roku
await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);
// await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);
//convert a hostname to an ip address
const deepLinkUrl = await util.resolveUrl(this.launchConfiguration.deepLinkUrl);
//send the deep link http request
Expand Down Expand Up @@ -507,23 +509,17 @@ export class BrightScriptDebugSession extends BaseDebugSession {
}

private async publish() {
if (this.launchConfiguration.publishTask) {
util.log(`Executing task '${this.launchConfiguration.publishTask}' to upload the zip instead of having roku-deploy do it`);
await this.sendCustomRequest('executeTask', { task: this.launchConfiguration.publishTask });
return;
}

this.logger.log('Uploading zip');
const start = Date.now();
let packageIsPublished = false;

//delete any currently installed dev channel (if enabled to do so)
try {
if (this.launchConfiguration.deleteDevChannelBeforeInstall === true) {
await this.rokuDeploy.deleteInstalledChannel({
...this.launchConfiguration
} as any as RokuDeployOptions);
}
// if (this.launchConfiguration.deleteDevChannelBeforeInstall === true) {
// await this.rokuDeploy.deleteInstalledChannel({
// ...this.launchConfiguration
// } as any as RokuDeployOptions);
// }
} catch (e) {
const statusCode = e?.results?.response?.statusCode;
const message = e.message as string;
Expand Down Expand Up @@ -1256,7 +1252,7 @@ export class BrightScriptDebugSession extends BaseDebugSession {
protected async disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments, request?: DebugProtocol.Request) {
//return to the home screen
if (!this.enableDebugProtocol) {
await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);
// await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);
}
this.sendResponse(response);
await this.shutdown();
Expand Down Expand Up @@ -1537,7 +1533,7 @@ export class BrightScriptDebugSession extends BaseDebugSession {
//press the home button to return to the home screen
try {
this.logger.log('Press home button');
await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);
// await this.rokuDeploy.pressHomeButton(this.launchConfiguration.host, this.launchConfiguration.remotePort);
} catch (e) {
this.logger.error(e);
}
Expand Down

0 comments on commit 00b0a63

Please sign in to comment.