uni-ticket-system/node_modules/licia/kill.js
2023-12-05 10:11:10 +08:00

20 lines
413 B
JavaScript

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;