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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix relative wp-env paths when host filepaths contain spaces #473

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

joemcgill
Copy link
Member

This fixes the path passed to wp-env via the --env-cwd arg when pwd returns a file path containing a space.

Testing instructions

  1. Clone this repo to a folder locally that includes a space, like ~/Local Sites/plugin-check.
  2. Run a script like npm run lint-php and see that it's trying to run from /var/www/html/wp-content/plugins/Local
  3. Check out this PR
  4. Run the same script and see that it is running successful from /var/www/html/wp-content/plugins/plugin-check
joemcgill and others added 2 commits June 19, 2024 16:09
This fixes the path passed to `wp-env` via the --env-cwd arg when `pwd` returns a file path containing a space.

## Testing instructions

1. Clone this repo to a folder locally that includes a space, like `~/Local Sites/plugin-check`.
2. Run a script like `npm run lint-php` and see that it's trying to run from `/var/www/html/wp-content/plugins/Local`
3. Check out this PR
4. Run the same script and see that it is running successful from `/var/www/html/wp-content/plugins/plugin-check`
@joemcgill
Copy link
Member Author

This came up while helping @davidperezgar run PHPUnit tests locally, see #466 (comment)

@joemcgill
Copy link
Member Author

The Unit tests seem to be failing due to an old version of the wp-env package. I've raised a separate PR that should fix that issue here: #474.

@joemcgill joemcgill added the Infrastructure Issues for the overall plugin infrastructure label Jun 19, 2024
@joemcgill joemcgill self-assigned this Jun 19, 2024
@mukeshpanchal27 mukeshpanchal27 merged commit a87e36f into trunk Jun 20, 2024
10 checks passed
@mukeshpanchal27 mukeshpanchal27 deleted the fix/relative-wp-env-paths branch June 20, 2024 11:27
@joemcgill
Copy link
Member Author

Thanks, all!

@davidperezgar
Copy link
Member

Nice! thanks!!!

@davidperezgar
Copy link
Member

That will prevent a lot of users having random problem when using unit tests...

@swissspidy swissspidy modified the milestones: 1.1.0, 1.0.2 Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Issues for the overall plugin infrastructure
4 participants