Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docker-compose options for the phpunit and composer environments #50406

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/env/lib/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,22 @@ function spawnCommandDirectly( config, container, command, envCwd, spinner ) {
const hostUser = getHostUser();

// We need to pass absolute paths to the container.
envCwd = path.resolve( '/var/www/html', envCwd );
envCwd = path.resolve(
container === 'composer' ? '/app' : '/var/www/html',
envCwd
);

const useRun = container === 'phpunit' || container === 'composer';
const isTTY = process.stdout.isTTY;

const composeCommand = [
'-f',
config.dockerComposeConfigPath,
'exec',
useRun ? 'run' : 'exec',
! isTTY ? '--no-TTY' : '',
'-w',
envCwd,
useRun ? '--rm' : '',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested that empty string is acceptable when running exec (npx wp-env run cli ls)

'--user',
hostUser.fullUser,
container,
Expand Down