This repository has been archived by the owner on Jul 6, 2019. It is now read-only.
Fix #100 (Improved escaping of spaced paths on Windows) #141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #100
I went through the
npx
operations on a Windows 10 user account named "name with spaces" in it to figure out where the issue arises. Sincenpm
proper does work with accounts with spaces, I figured it was annpx
issue.The script crashes during the running of the child
npm
process to install the packages. Inspecting the arguments provided to theinstallPackages()
function, I decided to try escaping the path in theprefix
argument using thechild.escapeArg()
function. I left theasPath
asfalse
because setting it totrue
led to the script hanging for some reason.With these changes, I can run
npx
where before I couldn't:(Running in my
npx
local repository)Before
After
I included a unit test for
installPackages()
for this new behavior, modeled after the other previously-implemented tests.