Added macOS check to kill
This commit is contained in:
@@ -470,7 +470,13 @@ exports.kill_processes = async function ({process_name = null}) {
|
|||||||
console.log('*** Electron framework export: kill_processes() ***');
|
console.log('*** Electron framework export: kill_processes() ***');
|
||||||
console.log(process_name); // process_name or grep pattern
|
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) => {
|
child_process.exec(command, (err, stdout, stdin) => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
|
|||||||
Reference in New Issue
Block a user