Allow spaces in file paths for package build process #14789
Merged
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.
Description
Currently, the package build process fails when a path contains spaces, because the build script as well as the package location paths are not escaped in
bin/packages/watch.js
.This PR escapes both paths, to support spaces.
Additional information
The following error is thrown (Windows):
By adding double quotes to the
BUILD_CMD
variable inbin/packages/watch.js
and also the argument provided to the command (the path to the package to build), spaces are now supported.This is the only location in the code where a command gets constructed and executed "manually"; all other paths pass through node's
fs
which already supports spaces.Considerations
Since spaces in paths are usually escaped with a backslash on *nix, but with double quotes on Windows, I've opted for the latter since that works across all platforms. There are other approaches available to solve this problem, but this is the most unobtrusive.
How has this been tested?
This branch was tested on Windows (build 1809) and MacOS Mojave 10.14.2, using paths with as well as without spaces in the build path.
Run
npm run dev:packages
, change a file and verify that the build process finishes without errors.Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: