Added macOS check to kill

This commit is contained in:
Scott Idem
2022-05-06 19:19:36 -04:00
parent bf97d7acf1
commit abd0165164

View File

@@ -470,7 +470,13 @@ exports.kill_processes = async function ({process_name = null}) {
console.log('*** Electron framework export: kill_processes() ***');
console.log(process_name); // process_name or grep pattern
let command = `pkill ${process_name}`;
let command = '';
if (os.platform == 'darwin') {
command = `osascript -e 'quit app "${process_name}"'`;
} else {
command = `pkill ${process_name}`;
}
child_process.exec(command, (err, stdout, stdin) => {
if (err) throw err;
console.log(stdout);