Skip to content

Commit

Permalink
fix: allow spaces in file path
Browse files Browse the repository at this point in the history
Utilizing changes proposed by @svantreeck that allow spaces in the project's path and allowing options to be passed to webdriver_update.

Closes mllrsohn#64
Spaces in File Path
  • Loading branch information
davidwickman committed Jul 12, 2016
1 parent e66db95 commit e79196f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function getProtractorDir() {
}

var protractor = function(options) {
var files = [],
var env = process.env,
files = [],
child, args;

options = options || {};
Expand Down Expand Up @@ -52,9 +53,12 @@ var protractor = function(options) {
args.unshift(options.configFile);
}

child = child_process.spawn(path.resolve(getProtractorDir() + '/protractor'+winExt), args, {
// add protractor dir to path
env.Path = env.Path + ';' + getProtractorDir();

child = child_process.spawn("protractor" + winExt, args, {
stdio: 'inherit',
env: process.env
env: env
}).on('exit', function(code) {
if (child) {
child.kill();
Expand All @@ -81,6 +85,11 @@ var webdriver_update = function(opts, cb) {
args.push("--" + element);
});
}
if (options.args) {
options.args.forEach(function(element, index, array) {
args.push(element);
});
}
}
child_process.spawn(path.resolve(getProtractorDir() + '/webdriver-manager'+winExt), args, {
stdio: 'inherit'
Expand Down

0 comments on commit e79196f

Please sign in to comment.