Skip to content

Commit

Permalink
#224: spec/lib/runner.js: killProcessFamily() now works on Windows (u…
Browse files Browse the repository at this point in the history
…sing taskkill.exe)
  • Loading branch information
yeputons committed Jan 20, 2014
1 parent 5f3ce28 commit d9380fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var utils = require('./utils.js');
var wrench = require('wrench');
var fstream = require('fstream');

var meteoriteExecutable = path.resolve(path.join('bin', 'mrt.js'));
var meteoriteExecutable = path.resolve(path.join('bin', 'mrt.bat'));

var matchesSpecs = function(output, specs) {
return _.all(specs, function(spec) {
Expand All @@ -18,6 +18,13 @@ var matchesSpecs = function(output, specs) {

// kill the process family described by process, then send done the error
var killProcessFamily = function(child, error, done) {
if (process.platform === 'win32') {
// We do not use /PID <pid>, because it will fail if process was already terminated
exec('taskkill /F /T /FI "PID eq ' + child.pid + '"', function(killErr) {
done(error || killErr);
});
return;
}
// we need to grab a table of process ids and parent ids to form a tree out of
exec('ps -opid -oppid', function(err, rawData) {
// parse the list of process ids and parent ids
Expand Down

0 comments on commit d9380fb

Please sign in to comment.