File tree Expand file tree Collapse file tree 3 files changed +33
-10
lines changed Expand file tree Collapse file tree 3 files changed +33
-10
lines changed Original file line number Diff line number Diff line change 3737 "@types/mocha" : " ^5.2.1" ,
3838 "@types/node" : " 6.0.46" ,
3939 "@types/universal-analytics" : " 0.4.1" ,
40+ "cpx" : " ^1.5.0" ,
4041 "mocha" : " ^5.2.0" ,
4142 "sinon" : " ^5.0.10" ,
4243 "tslint" : " 5.10.0" ,
4950 "scripts" : {
5051 "clean" : " git clean -fdx" ,
5152 "postinstall" : " node ./node_modules/vscode/bin/install" ,
52- "build" : " tsc -p ./src" ,
53+ "build" : " tsc -p ./src && cpx src/common/*.sh out/common " ,
5354 "package" : " vsce package" ,
5455 "full-build" : " npm run clean && npm install && npm run build && npm run package" ,
5556 "launch-as-server" : " node --nolazy ./out/debug-adapter/nativeScriptDebug.js --server=4712" ,
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ terminateTree () {
4+ for cpid in $( /usr/bin/pgrep -P $1 ) ; do
5+ terminateTree $cpid
6+ done
7+ kill -9 $1 > /dev/null 2>&1
8+ }
9+
10+ for pid in $* ; do
11+ terminateTree $pid
12+ done
Original file line number Diff line number Diff line change 1- import { ChildProcess , exec } from 'child_process' ;
1+ import { ChildProcess , execSync } from 'child_process' ;
22import * as os from 'os' ;
3+ import * as path from 'path' ;
4+ import { ILogger , LogLevel } from '../common/logger' ;
35
4- export function killProcess ( childProcess : ChildProcess ) : void {
5- switch ( process . platform ) {
6- case 'win32' :
7- exec ( `taskkill /pid ${ childProcess . pid } /T /F` ) ;
8- break ;
6+ export function killProcess ( childProcess : ChildProcess , logger ?: ILogger ) : void {
7+ logger && logger . log ( `Stopping process: ${ childProcess . pid } ` ) ;
98
10- default :
11- childProcess . kill ( 'SIGINT' ) ;
12- break ;
9+ try {
10+ switch ( process . platform ) {
11+ case 'win32' :
12+ execSync ( `taskkill /pid ${ childProcess . pid } /T /F` ) ;
13+ break ;
14+
15+ default :
16+ const cmd = path . join ( __dirname , 'terminateProcess.sh' ) ;
17+
18+ execSync ( `${ cmd } ${ childProcess . pid . toString ( ) } ` ) ;
19+ break ;
20+ }
21+ } catch ( error ) {
22+ logger && logger . log ( error , LogLevel . Error ) ;
1323 }
1424}
1525
You can’t perform that action at this time.
0 commit comments