Skip to content

Commit 4f44e26

Browse files
authored
Merge pull request #127 from NativeScript/yosifov/terminate-debugger-on-exit
When the TNS process is finished - terminate the debugger process, too.
2 parents da67d99 + ebc2486 commit 4f44e26

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/debug-adapter/webKitDebugAdapter.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*---------------------------------------------------------
22
* Copyright (C) Microsoft Corporation. All rights reserved.
33
*--------------------------------------------------------*/
4-
54
import * as os from 'os';
65
import * as fs from 'fs';
76
import * as path from 'path';
@@ -160,6 +159,12 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
160159
cliCommand.tnsProcess.stderr.on('data', data => { Services.logger().error(data.toString(), Tags.FrontendMessage); });
161160
cliCommand.tnsProcess.on('close', (code, signal) => {
162161
Services.logger().error(`[NSDebugAdapter] The tns command finished its execution with code ${code}.`, Tags.FrontendMessage);
162+
163+
// Sometimes we execute "tns debug android --start" and the process finishes
164+
// which is totally fine. If there's an error we need to Terminate the session.
165+
if(code > 0) {
166+
this.fireEvent(new TerminatedEvent());
167+
}
163168
});
164169
}
165170

0 commit comments

Comments
 (0)