File tree Expand file tree Collapse file tree 3 files changed +34
-10
lines changed Expand file tree Collapse file tree 3 files changed +34
-10
lines changed Original file line number Diff line number Diff line change 25
25
],
26
26
"license" : " SEE LICENSE IN LICENSE.txt" ,
27
27
"dependencies" : {
28
+ "cpx" : " ^1.5.0" ,
28
29
"lodash" : " ^4.17.10" ,
29
30
"semver" : " ^5.5.0" ,
30
31
"universal-analytics" : " 0.4.15" ,
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 , spawnSync } 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
}
24
+
14
25
}
15
26
16
27
export const enum Platform {
You can’t perform that action at this time.
0 commit comments