Skip to content

Commit

Permalink
fix(core): Allow Windows paths containing a white-space
Browse files Browse the repository at this point in the history
If you install Yarn through the msi install, it will install itself under `C:/Program Files/` however, gulp-yarn does not escape white-spaces in the path, which causes errors such as:

`'C:\Program' is not recognized as an internal or external command,
operable program or batch file.`

This PR, will add quotes around the filepath so that windows will not throw the error.

Tested:
Windows 10
Yarn 1.3.2
Node 9.4.0
  • Loading branch information
BillyBlaze committed Feb 1, 2018
1 parent c93a597 commit 8e1d221
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function gulpYarn(gulpYarnOptions) {
shell: true,
cwd: singleCommand.cwd || process.cwd()
};
var cmd = childProcess.spawn(cmdpath, singleCommand.args, installOptions);
var cmd = childProcess.spawn(`"${cmdpath}"`, singleCommand.args, installOptions);
cmd.once('close', function (code) {
if (code !== 0) {
next(new PluginError(PLUGIN_NAME, `${command.cmd} exited with non-zero code ${code}.`));
Expand Down

0 comments on commit 8e1d221

Please sign in to comment.