Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"grunt": "grunt",
"lint:jsdoc": "wp-scripts lint-js",
"lint:jsdoc:fix": "wp-scripts lint-js --fix",
"env:start": "node ./tools/local-env/scripts/start.js && node ./tools/local-env/scripts/docker.js run -T --rm php composer update -W",
"env:start": "node ./tools/local-env/scripts/start.js",
"env:stop": "node ./tools/local-env/scripts/docker.js down",
"env:restart": "npm run env:stop && npm run env:start",
"env:clean": "node ./tools/local-env/scripts/docker.js down -v --remove-orphans",
Expand Down
25 changes: 25 additions & 0 deletions tools/local-env/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,31 @@ spawnSync(
{ stdio: 'inherit' }
);

const result = spawnSync(
'docker',
[
'compose',
...composeFiles.map( ( composeFile ) => [ '-f', composeFile ] ).flat(),
'run',
'-T',
'--rm',
'php',
'composer',
'update',
'-W',
],
{ stdio: 'inherit' }
);

if ( result.status !== 0 ) {
console.error( '\nThere was an error while running PHP composer update.' );
console.error(
'This is often caused by network issues or Packagist.org downtime.'
);
console.error( 'Please check your internet connection and try again.' );
process.exit( 1 );
}

// If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM.
if ( process.env.DOCKER_TOOLBOX_INSTALL_PATH ) {
// VBoxManage is added to the PATH on every platform except Windows.
Expand Down
Loading