How to use fkill - 4 common examples

To help you get started, we’ve selected a few fkill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium-ios-simulator / lib / utils.js View on Github external
if (stdout.trim()) {
      pids.push(...(stdout.trim().split(/\s+/)));
    }
  } catch (e) {
    if (e.code === 1) {
      log.debug(`${appName} is not running. Continuing...`);
      return;
    }
    if (_.isEmpty(pids)) {
      log.warn(`pgrep error ${e.code} while detecting whether ${appName} is running. Trying to kill anyway.`);
    }
  }
  if (!_.isEmpty(pids)) {
    log.debug(`Using fkill to kill processes: ${pids.join(', ')}`);
    try {
      await fkill(pids, {force: true});
    } catch (ign) {}
  }

  log.debug(`Using pkill to kill application: ${appName}`);
  try {
    await pkill(appName, true);
  } catch (ign) {}

  // wait for all the devices to be shutdown before Continuing
  // but only print out the failed ones when they are actually fully failed
  let remainingDevices = [];
  async function allSimsAreDown () {
    remainingDevices = [];
    let devices = await getDevices();
    devices = _.flatten(_.values(devices));
    return _.every(devices, (sim) => {
github lnlfps / symph-joy / test / lib / joy-test-utils.js View on Github external
export async function killApp (instance) {
  await fkill(instance.pid)
}
github ewnd9 / media-center / src / players / omx.js View on Github external
OmxPlayer.prototype.stop = function() {
  BasePlayer.prototype.stop.apply(this);
  fkill('omxplayer.bin').then(() => console.log('success'), err => console.log(err));
};
github hello-efficiency-inc / ridereceipts / src / main / index.js View on Github external
app.on('quit', () => {
  if (store.has('processPID')) {
    fkill(store.get('processPID', {
      force: true
    }))
    store.delete('processPID')
  }
})

fkill

Fabulously kill processes. Cross-platform.

MIT
Latest version published 4 months ago

Package Health Score

70 / 100
Full package analysis

Popular fkill functions