@joystick.js/cli-canary 0.0.0-canary.647 → 0.0.0-canary.649
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"child_process";import e from"util";const s=e.promisify(t.exec),o=async(r=0)=>{const i=parseInt(r,10);if(i){if(process.platform==="win32"){await s(`taskkill /F /PID ${i}`);return}await s(`kill -9 ${i}`)}};var l=o;export{l as default};
|
package/package.json
CHANGED
|
@@ -4,13 +4,15 @@ import util from 'util';
|
|
|
4
4
|
const exec = util.promisify(child_process.exec);
|
|
5
5
|
|
|
6
6
|
const kill_process_id = async (process_id = 0) => {
|
|
7
|
-
|
|
7
|
+
const process_id_as_integer = parseInt(process_id, 10);
|
|
8
|
+
|
|
9
|
+
if (process_id_as_integer) {
|
|
8
10
|
if (process.platform === 'win32') {
|
|
9
|
-
await exec(`taskkill /F /PID ${
|
|
11
|
+
await exec(`taskkill /F /PID ${process_id_as_integer}`);
|
|
10
12
|
return;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
await exec(`kill -9 ${
|
|
15
|
+
await exec(`kill -9 ${process_id_as_integer}`);
|
|
14
16
|
}
|
|
15
17
|
};
|
|
16
18
|
|