Skip to content

Derive the plugin directory name in the wp-env scripts - #276

Open
sirreal wants to merge 1 commit into
masterfrom
wp-env-plugin-dir
Open

Derive the plugin directory name in the wp-env scripts#276
sirreal wants to merge 1 commit into
masterfrom
wp-env-plugin-dir

Conversation

@sirreal

Copy link
Copy Markdown
Member

The wp-env npm scripts (composer, composer:setup, test:phpunit) hardcode wp-content/plugins/phpdoc-parser as the container path. wp-env mounts the checkout under its directory basename, so the scripts break for any checkout not named exactly phpdoc-parser — git worktrees, renamed clones.

Derive the path with $(basename "$PWD") so the scripts work for any checkout name. Verified by running the suite through npm run test:phpunit from a worktree named phpdoc-parser-pr262-fixes.

Extracted from #262 to keep that PR focused on export semantics.

🤖 Generated with Claude Code

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.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@sirreal