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 37
37
"@types/mocha" : " ^5.2.1" ,
38
38
"@types/node" : " 6.0.46" ,
39
39
"@types/universal-analytics" : " 0.4.1" ,
40
+ "cpx" : " ^1.5.0" ,
40
41
"mocha" : " ^5.2.0" ,
41
42
"sinon" : " ^5.0.10" ,
42
43
"tslint" : " 5.10.0" ,
49
50
"scripts" : {
50
51
"clean" : " git clean -fdx" ,
51
52
"postinstall" : " node ./node_modules/vscode/bin/install" ,
52
- "build" : " tsc -p ./src" ,
53
+ "build" : " tsc -p ./src && cpx src/common/*.sh out/common " ,
53
54
"package" : " vsce package" ,
54
55
"full-build" : " npm run clean && npm install && npm run build && npm run package" ,
55
56
"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' ;
2
2
import * as os from 'os' ;
3
+ import * as path from 'path' ;
4
+ import { ILogger , LogLevel } from '../common/logger' ;
3
5
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 } ` ) ;
9
8
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 ) ;
13
23
}
14
24
}
15
25
You can’t perform that action at this time.
0 commit comments