Skip to content

When the TNS process is finished - terminate the debugger process, too. #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2017
Merged
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
7 changes: 6 additions & 1 deletion src/debug-adapter/webKitDebugAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/

import * as os from 'os';
import * as fs from 'fs';
import * as path from 'path';
Expand Down Expand Up @@ -160,6 +159,12 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
cliCommand.tnsProcess.stderr.on('data', data => { Services.logger().error(data.toString(), Tags.FrontendMessage); });
cliCommand.tnsProcess.on('close', (code, signal) => {
Services.logger().error(`[NSDebugAdapter] The tns command finished its execution with code ${code}.`, Tags.FrontendMessage);

// Sometimes we execute "tns debug android --start" and the process finishes
// which is totally fine. If there's an error we need to Terminate the session.
if(code > 0) {
this.fireEvent(new TerminatedEvent());
}
});
}

Expand Down