kill-running-atom-instances.js
1 const childProcess = require('child_process'); 2 3 const CONFIG = require('../config.js'); 4 5 module.exports = function() { 6 if (process.platform === 'win32') { 7 // Use START as a way to ignore error if Atom.exe isnt running 8 childProcess.execSync(`START taskkill /F /IM ${CONFIG.executableName}`); 9 } else { 10 childProcess.execSync(`pkill -9 ${CONFIG.appMetadata.productName} || true`); 11 } 12 };