diff --git a/app/package.json b/app/package.json index 1970591..10ef67d 100644 --- a/app/package.json +++ b/app/package.json @@ -8,6 +8,7 @@ "electron-settings": "^1.0.4", "electron-window-state": "^3.0.3", "fix-path": "^2.0.0", + "ps-tree": "^1.1.0", "vue": "^1.0.24", "vue-electron": "^1.0.0", "vue-router": "^0.7.13", diff --git a/app/src/components/RepoView/CommandOutput.vue b/app/src/components/RepoView/CommandOutput.vue index 8328ac2..ff1306b 100644 --- a/app/src/components/RepoView/CommandOutput.vue +++ b/app/src/components/RepoView/CommandOutput.vue @@ -149,6 +149,7 @@ data() { return { exec : this.$electron.remote.require( 'child_process' ).exec, + psTree : this.$electron.remote.require( 'ps-tree' ), process : null, processStatus : null, processCmd : null, @@ -185,7 +186,11 @@ killScript() { if ( this.process ) { - this.process.kill( 'SIGTERM' ); + // make sure also child processes + // of child processes get killed + this.psTree( this.process.pid, ( err, children ) => { + this.exec( `kill -9 ${ children.map( p => p.PID ).join( ' ' ) }` ); + } ); } }, diff --git a/config.js b/config.js index 208da1a..f074bff 100644 --- a/config.js +++ b/config.js @@ -11,7 +11,7 @@ const config = { vueDevTools : false, build : { 'app-version' : pkg.version, - packagesToBeIncluded : [ 'fix-path', 'electron-window-state' ], + packagesToBeIncluded : [ 'fix-path', 'electron-window-state', 'ps-tree' ], overwrite : true, asar : true, dmg : {