WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
195 stars 39 forks source link

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

Closed joemcgill closed 1 week ago

joemcgill commented 1 week ago

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 commented 1 week ago

This came up while helping @davidperezgar run PHPUnit tests locally, see https://github.com/WordPress/plugin-check/issues/466#issuecomment-2179449685

joemcgill commented 1 week ago

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 commented 1 week ago

Thanks, all!

davidperezgar commented 1 week ago

Nice! thanks!!!

davidperezgar commented 1 week ago

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