wp-cli / scaffold-command

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.
MIT License
165 stars 87 forks source link

Fix: correctly check paths when running scaffold command for themes and plugins from outside directory. #307

Closed NielsdeBlaauw closed 2 years ago

NielsdeBlaauw commented 2 years ago

parent_dir contains a normalized path whereas WP_CONTENT_DIR contains a relative path. By running the WP_CONTENT_DIR through realpath we get a path we can actually compare between the target dir and where we want to place the new theme.

Fixes #263 Also fixes #251

janw-me commented 2 years ago

If I remember correctly the tests failed from the start right?

danielbachhuber commented 2 years ago

Proceeding with https://github.com/wp-cli/wp-cli/issues/5594 for this repository. I've captured this PR to https://gist.github.com/danielbachhuber/2951826b5cee4db3c8245ff095d5b7de in case this PR is auto-closed or broken in some way.