prevented undefined from getting passed to path.join in the yaml test runner

This commit is contained in:
Spencer Alger
2013-10-24 10:47:21 -07:00
parent cc1509cef3
commit 6ae5c30b2e
2 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,7 @@ var path = require('path'),
Minimatch = require('minimatch').Minimatch;
var argv = require('optimist')
.default('executable', path.join(process.env.ES_HOME, './bin/elasticsearch'))
.default('executable', process.env.ES_HOME ? path.join(process.env.ES_HOME, './bin/elasticsearch') : null)
.default('clusterName', 'yaml-test-runner')
.default('dataPath', '/tmp/yaml-test-runner')
.default('hostname', 'localhost')

View File

@ -6,8 +6,9 @@ var childProc = require('child_process'),
exports.start = function (params, cb) {
if (!fs.existsSync(params.executable)) {
return cb(new Error('unable to find elasticsearch executable'));
if (!params.executable || !fs.existsSync(params.executable)) {
return cb(new Error('unable to find elasticsearch executable, ' +
'set ES_HOME env var to the instalation path of elasticsearch'));
}
var server = childProc.spawn(