Files
yusheng-h5/uni_modules/UniDevTools/node_modules/licia/kill.js

20 lines
413 B
JavaScript
Raw Normal View History

2025-08-11 11:06:07 +08:00
const isWindows = require('./isWindows');
const childProcess = require('child_process');
exports = function(pid) {
try {
let cmd = '';
if (isWindows) {
cmd = `taskkill /pid ${pid} /T /F`;
} else {
cmd = `kill ${pid} -9`;
}
childProcess.execSync(cmd);
} catch (e) {
/* eslint-disable no-empty */
}
};
module.exports = exports;