update-api-docs.js: execa returns error if file path has space(s) in it #22512
Labels
[Type] Bug
An existing feature does not function as intended
[Type] Build Tooling
Issues or PRs related to build tooling
Describe the bug
This issue refers to the
bin/api-docs/update-api-docs.js
file. In this script, we're usingexeca
to executedocgen
, specifically in this line.If your path to the WordPress installation has spaces in it,
execa
fails with an error code 127. When you runnode ./bin/api-docs/update-api-docs.js
, here's what the entire error message looks like:As you can see in the above error message, this specific test site of mine exists in a folder which contains "
Local by Flywheel
", i.e. with spaces in it. I understand having such an environment/site path is not the best practice, but I think we should do something for contributors who does have such a setup.I did some research and found a (sort of) relevant issue in
execa
: sindresorhus/execa#408. Then, I landed upon this issue innode
: nodejs/node#6803 and upon further reading, it appears that it is a limitation withinchild_processes
, and the documentation suggests quoting the path if it has spaces in it.I'll submit a PR with the path quoted so that it works with such a file structure setup.
To reproduce
Steps to reproduce the behaviour:
/Users/<username>/Sites/Word Press
(ugh naughty!)node ./bin/api-docs/update-api-docs.js
.Expected behavior
It shouldn't return such an error merely for the file path.
Editor version (please complete the following information):
5.4.1
8.1.0
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: