-
Notifications
You must be signed in to change notification settings - Fork 120
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
Always use where command provided by Windows #70
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
490bd3a
to
4831370
Compare
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
This looks and feels good to me, can you please add a note in the CHANGELOG.md about the fix - then we should be good to go. @gabelevi - think you can do a quick look over this (as you're a windows user I believe) and then ship a release? |
Thanks for the PR @JPanneel :D |
5be4ce7
to
16ee7e4
Compare
Awesome, thanks for fixing this @JPanneel! I'm afraid I'm travelling without my Windows laptop this week and I don't have enough space to spin up a Windows VM. The code looks good to me when I read it, but ideally someone would test the plugin on Windows before I deploy. @JPanneel - What was your test plan? @orta - would you mind if I relied on @JPanneel's Windows testing and just tested on OSX before releasing? |
@gabelevi I can only test on Windows 10 though, but then again C:\Windows\System32\where has been there for quite some time... |
Yeah, this seems 👍 to me |
I tested 4 configurations. 1 and 2 work as intended, 3 and 4 have 2 issues:
Issues:
|
Agreed |
I added the text "On Windows use '\' as directory separator" to the settings description. What about?
Do relative paths even make sense in this situation? Maybe something for a separate pull request as this was about useNPMPackagesFlow... |
By using the absolute path to the where executable provided by Windows we avoid issues with other variants of the where command on the user's path. C:\Windows\System32\where.exe can be used to search a directory: where /r <dir> <command>
16ee7e4
to
c7d206f
Compare
I initially thought that the path option would handle relative paths, so I'm in favour of the idea, but happy for it to move to another PR |
Ok, so: Works on my machine! (except for relative paths) Would be nice if someone else could confirm though... |
I think there's no need to have the user escape the backslashes if you wrap the directory in double quotes when passing it to This should also allow users to provide paths that have spaces in them on Windows. |
When passing the command to where, it actually contains only single backslashes. I think it is while reading it from the settings file into the config variable that the backslash is interpreted as an escape character. |
Hrm, I'd rather this not sit idle - @JPanneel wanna give it one more look over and then if you give it the 👍 - I'm good to go |
Ok, I tested this out on my Windows machine. I made a small change to
In each case, this extension seemed to work. So this seems good to merge! I think that little bit of logging is useful, so I'll commit it separately. |
#69
By using the absolute path to the where executable provided by Windows
we avoid issues with other variants of the where command on the user's
path.
C:\Windows\System32\where.exe can be used to search a directory:
where /r