Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow spaces in file path #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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