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

Spaces in File Path #64

Open
RDalziel opened this issue May 18, 2015 · 12 comments
Open

Spaces in File Path #64

RDalziel opened this issue May 18, 2015 · 12 comments
Labels

Comments

@RDalziel
Copy link

I've been currently working on a TFS Build which will spin up selenium and run protractor tests against a deployment.

Whilst setting this up, i noticed that if my folder path for where the node_modules folder is located contains a space, gulp protractor bombs out when trying to reference one of the file paths.

For example:

'c:\dev\folder\node_modules\gulp-protractor' works absolutely fine
'c:\dev\new folder\node_modules\gulp-protractor' will throw an error along the lines of 'c:\dev\new' is an unrecognised command'

I managed to get round the error by just re-working how my folder paths are named, but thought i'd mention anyway!

@Freundschaft
Copy link

same issue here as well, the plugin doesnt work well with spaces in file path

@GustavSt
Copy link

I got this issue as well, the problem for we is it's in my User folder and my user name contains a space..

@jeroenlorrentop
Copy link

Any news on this issue?

@mattfritz mattfritz added the bug label Nov 30, 2015
@mattfritz
Copy link
Collaborator

I'll take a look at this later this week, thanks for the detailed report.

@AdamWillden
Copy link

@mattfritz any news? I'm encountering the same issue

@mattfritz
Copy link
Collaborator

I have changes pushed to the windows-path-support branch. Can someone with a Windows box clone this repo, check out windows-path-support, and use npm link to test the changes? I don't have access to a Windows machine. Let me know and I'll integrate it. Thanks!

@Charlynux
Copy link

Hello @mattfritz,

Get the same error, so I give a try to your solution.

First, child_process.exec seems to don't take "args" argument. According to this documentation, child_process.execFile does.
Not being a Node.js expert, I can't say what's the impact to change from one to another.

Just in case, I replace exec by execFile and get another error :

Error: Cannot find module 'C:\Program Files (x86)\...\workspace\node_modules\gulp-protractor\node_modules\.bin\protractor.conf.js'

Working directory being : "C:\Program Files...", Protractor search my config file in this directory.

To correct this I just wrap options.configFile with path.resolve :

// Pass in the config file
if (options.configFile) {
      args.unshift(path.resolve(options.configFile));
}

Now it seems to work. Hope this help you.

@Charlynux
Copy link

I just realised : with execFile, I lose stdout.
Rolling back to spawnrestore stdout and continue to fixing the "space path" problem.

@slx2005
Copy link

slx2005 commented Jun 22, 2016

@Charlynux by any chance have you found any other fix?

@Charlynux
Copy link

I discover that changing the working directory (via cwd option) have some drawbacks. In my case, I use a plugin for screenshots and pictures are saved relative to the working directory.
I made some tests, but was not able to find another way to correct the problem.

So, I just move my Jenkins directory to a path without space...

davidwickman added a commit to davidwickman/gulp-protractor that referenced this issue Jul 12, 2016
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
@davidwickman
Copy link

I have a PR in for this fix.
#112

@alexfromapex
Copy link

+1 This is also affecting me on Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants