Skip to content

Commit d9380fb

Browse files
committed
#224: spec/lib/runner.js: killProcessFamily() now works on Windows (using taskkill.exe)
1 parent 5f3ce28 commit d9380fb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spec/lib/runner.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var utils = require('./utils.js');
88
var wrench = require('wrench');
99
var fstream = require('fstream');
1010

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

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

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

0 commit comments

Comments
 (0)