Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle non-existant wp-env.json file #18294

Merged
merged 2 commits into from Nov 6, 2019
Merged

Conversation

@talldan
Copy link
Contributor

talldan commented Nov 6, 2019

Description

Attempted to restart my gutenberg env npx wp-env start on the latest mater, but it looks like since #18121 a wp-env.json file is expected, the following error occurred:

ENOENT: no such file or directory, open './wp-env.json'

I think either this file should be defined in gutenberg or the code could handle the file not being there. Not sure which! This PR is my naive attempt at a fix 馃槃

From a brief look at the code it seems like it should be optional.

How has this been tested?

Ran npx wp-env start, didn't receive the error and my environment was created.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
@talldan talldan requested a review from epiqueras Nov 6, 2019
@talldan talldan self-assigned this Nov 6, 2019
@talldan

This comment has been minimized.

Copy link
Contributor Author

talldan commented Nov 6, 2019

cc @noahtallen I don't seem to be able to add you as a reviewer, but your feedback would be appreciated.

@epiqueras

This comment has been minimized.

Copy link
Contributor

epiqueras commented Nov 6, 2019

From a brief look at the code it seems like it should be optional.

Yes definitely, thanks for fixing this!

packages/env/lib/resolve-dependencies.js Outdated Show resolved Hide resolved
@talldan

This comment has been minimized.

Copy link
Contributor Author

talldan commented Nov 6, 2019

Thanks for the quick review @epiqueras!

@talldan talldan merged commit f3fb987 into master Nov 6, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@talldan talldan deleted the fix/wp-env-json-no-such-file branch Nov 6, 2019
@noahtallen

This comment has been minimized.

Copy link
Contributor

noahtallen commented Nov 6, 2019

Thanks for the fix @talldan! This is definitely the behavior I would expect too.

I don't seem to be able to add you as a reviewer

Unfortunately, I鈥檓 not yet a member of the WordPress org :(

@youknowriad youknowriad added this to the Gutenberg 6.9 milestone Nov 11, 2019
CreativeDive added a commit to CreativeDive/gutenberg that referenced this pull request Nov 12, 2019
* Handle non-existant wp-env.json file

* Update packages/env/lib/resolve-dependencies.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can鈥檛 perform that action at this time.