Skip to content

Commit

Permalink
Use exec, not spawn, to kill Chrome process on Windows (#1206)
Browse files Browse the repository at this point in the history
Using `childProcess.spawnSync` fails on Windows. `childProcess.execSync` works fine.
  • Loading branch information
XhmikosR authored and brendankenny committed Dec 22, 2016
1 parent 0b5f5bb commit 1513a1d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lighthouse-cli/chrome-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const rimraf = require('rimraf');
const log = require('../lighthouse-core/lib/log');
const spawn = childProcess.spawn;
const execSync = childProcess.execSync;
const spawnSync = childProcess.spawnSync;

class ChromeLauncher {
prepared: Boolean = false
Expand Down Expand Up @@ -215,7 +214,7 @@ class ChromeLauncher {

log.log('ChromeLauncher', 'Killing all Chrome Instances');
if (process.platform === 'win32') {
spawnSync(`taskkill /pid ${this.chrome.pid} /T /F`);
execSync(`taskkill /pid ${this.chrome.pid} /T /F`);
} else {
process.kill(-this.chrome.pid);
}
Expand Down

0 comments on commit 1513a1d

Please sign in to comment.