Uh oh!
There was an error while loading. Please reload this page.
Derive the plugin directory name in the wp-env scripts - #276
Open
sirreal wants to merge 1 commit into
Open
Conversation
wp-env mounts the checkout at wp-content/plugins/<directory name>, but the scripts passed a fixed --env-cwd of wp-content/plugins/phpdoc-parser. A checkout in a differently named directory, such as a git worktree, ran the commands in a path that does not exist in the container. Build the path from the current directory name so the scripts work wherever the repository is checked out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The wp-env npm scripts (
composer,composer:setup,test:phpunit) hardcodewp-content/plugins/phpdoc-parseras the container path. wp-env mounts the checkout under its directory basename, so the scripts break for any checkout not named exactlyphpdoc-parser— git worktrees, renamed clones.Derive the path with
$(basename "$PWD")so the scripts work for any checkout name. Verified by running the suite throughnpm run test:phpunitfrom a worktree namedphpdoc-parser-pr262-fixes.Extracted from #262 to keep that PR focused on export semantics.
🤖 Generated with Claude Code