Skip to content

Commit

Permalink
wp-env: Make env-cwd option work on Windows (#56265)
Browse files Browse the repository at this point in the history
* Gutenberg Project: Make env-cwd option work on Windows

* Remove only the first and last space and single quote

* Move the logic to trim into the `run()` function

* Move the logic to trim into the spawnCommandDirectly() function

* Add comment
  • Loading branch information
t-hamano authored Dec 5, 2023
1 parent 19f944d commit c362e62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/env/lib/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ function spawnCommandDirectly( config, container, command, envCwd, spinner ) {
container === 'mysql' || container === 'tests-mysql'
? '/'
: '/var/www/html',
envCwd
// Remove spaces and single quotes from both ends of the path.
// This is needed because Windows treats single quotes as a literal character.
envCwd.trim().replace( /^'|'$/g, '' )
);

const composeCommand = [
Expand Down

1 comment on commit c362e62

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in c362e62.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7101189396
📝 Reported issues:

Please sign in to comment.