From d39ab693255eb58d9c8388fecd04d110f0b79398 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Mon, 10 Aug 2026 20:09:16 +0400 Subject: [PATCH] Derive the plugin directory name in the wp-env scripts wp-env mounts the checkout at wp-content/plugins/, 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. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3595937..e48e068 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "setup": "npm-run-all start start:test composer:setup", "start": "wp-env start", "start:test": "wp-env --config .wp-env.test.json start", - "composer": "wp-env --config .wp-env.test.json run --env-cwd='wp-content/plugins/phpdoc-parser' wordpress composer --no-interaction --no-security-blocking", - "composer:setup": "wp-env --config .wp-env.test.json run --env-cwd='wp-content/plugins/phpdoc-parser' wordpress composer install --no-interaction --no-security-blocking", + "composer": "wp-env --config .wp-env.test.json run --env-cwd=\"wp-content/plugins/$(basename \"$PWD\")\" wordpress composer --no-interaction --no-security-blocking", + "composer:setup": "wp-env --config .wp-env.test.json run --env-cwd=\"wp-content/plugins/$(basename \"$PWD\")\" wordpress composer install --no-interaction --no-security-blocking", "test:phpunit:setup": "npm-run-all start:test composer:setup", - "test:phpunit": "wp-env --config .wp-env.test.json run --env-cwd='wp-content/plugins/phpdoc-parser' wordpress vendor/phpunit/phpunit/phpunit -c phpunit.xml.dist" + "test:phpunit": "wp-env --config .wp-env.test.json run --env-cwd=\"wp-content/plugins/$(basename \"$PWD\")\" wordpress vendor/phpunit/phpunit/phpunit -c phpunit.xml.dist" }, "repository": { "type": "git",