@wordpress/env 8.12.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cli.js CHANGED
@@ -58,10 +58,10 @@ const withSpinner =
58
58
  'err' in error &&
59
59
  'out' in error
60
60
  ) {
61
- // Error is a docker-compose error. That means something docker-related failed.
61
+ // Error is a docker compose error. That means something docker-related failed.
62
62
  // https://github.com/PDMLab/docker-compose/blob/HEAD/src/index.ts
63
63
  spinner.fail(
64
- 'Error while running docker-compose command.'
64
+ 'Error while running docker compose command.'
65
65
  );
66
66
  if ( error.out ) {
67
67
  process.stdout.write( error.out );
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- const dockerCompose = require( 'docker-compose' );
5
+ const { v2: dockerCompose } = require( 'docker-compose' );
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- const dockerCompose = require( 'docker-compose' );
5
+ const { v2: dockerCompose } = require( 'docker-compose' );
6
6
  const util = require( 'util' );
7
7
  const fs = require( 'fs' ).promises;
8
8
  const path = require( 'path' );
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- const dockerCompose = require( 'docker-compose' );
5
+ const { v2: dockerCompose } = require( 'docker-compose' );
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -74,10 +74,13 @@ function spawnCommandDirectly( config, container, command, envCwd, spinner ) {
74
74
  container === 'mysql' || container === 'tests-mysql'
75
75
  ? '/'
76
76
  : '/var/www/html',
77
- envCwd
77
+ // Remove spaces and single quotes from both ends of the path.
78
+ // This is needed because Windows treats single quotes as a literal character.
79
+ envCwd.trim().replace( /^'|'$/g, '' )
78
80
  );
79
81
 
80
82
  const composeCommand = [
83
+ 'compose',
81
84
  '-f',
82
85
  config.dockerComposeConfigPath,
83
86
  'exec',
@@ -98,7 +101,7 @@ function spawnCommandDirectly( config, container, command, envCwd, spinner ) {
98
101
  // cannot use it to spawn an interactive command. Thus, we run docker-
99
102
  // compose on the CLI directly.
100
103
  const childProc = spawn(
101
- 'docker-compose',
104
+ 'docker',
102
105
  composeCommand,
103
106
  { stdio: 'inherit' },
104
107
  spinner
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- const dockerCompose = require( 'docker-compose' );
5
+ const { v2: dockerCompose } = require( 'docker-compose' );
6
6
  const util = require( 'util' );
7
7
  const path = require( 'path' );
8
8
  const fs = require( 'fs' ).promises;
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- const dockerCompose = require( 'docker-compose' );
5
+ const { v2: dockerCompose } = require( 'docker-compose' );
6
6
 
7
7
  /**
8
8
  * Internal dependencies
package/lib/test/cli.js CHANGED
@@ -138,7 +138,7 @@ describe( 'env cli', () => {
138
138
  await env.start.mock.results[ 0 ].value.catch( () => {} );
139
139
 
140
140
  expect( spinner.fail ).toHaveBeenCalledWith(
141
- 'Error while running docker-compose command.'
141
+ 'Error while running docker compose command.'
142
142
  );
143
143
  expect( process.stderr.write ).toHaveBeenCalledWith( 'failure error' );
144
144
  expect( process.exit ).toHaveBeenCalledWith( 1 );
package/lib/wordpress.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- const dockerCompose = require( 'docker-compose' );
5
+ const { v2: dockerCompose } = require( 'docker-compose' );
6
6
  const util = require( 'util' );
7
7
  const fs = require( 'fs' ).promises;
8
8
  const path = require( 'path' );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/env",
3
- "version": "8.12.0",
3
+ "version": "9.0.0",
4
4
  "description": "A zero-config, self contained local WordPress environment for development and testing.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "chalk": "^4.0.0",
36
36
  "copy-dir": "^1.3.0",
37
- "docker-compose": "^0.22.2",
37
+ "docker-compose": "^0.24.3",
38
38
  "extract-zip": "^1.6.7",
39
39
  "got": "^11.8.5",
40
40
  "inquirer": "^7.1.0",
@@ -51,5 +51,5 @@
51
51
  "scripts": {
52
52
  "test": "echo \"Error: run tests from root\" && exit 1"
53
53
  },
54
- "gitHead": "839018ff6029ba749780e288e08ff9cd898e50e8"
54
+ "gitHead": "fcf61b4beff747222c2c81d09d757ca1a0abd925"
55
55
  }