Make WordPress Core

Changeset 55473


Ignore:
Timestamp:
03/07/2023 09:07:25 AM (21 months ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Check if the Docker is available when running npm run env:start.

This aims to display a more helpful error message if the Docker service is not running.

Follow-up to [45783], [45819].

Props mkox, cnspecialcolor, pento, hasanuzzamanshamim, bgoewert, robinwpdeveloper, costdev, mukesh27.
Fixes #51898.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/local-env/scripts/start.js

    r54350 r55473  
    44
    55dotenvExpand.expand( dotenv.config() );
     6
     7// Check if the Docker service is running.
     8try {
     9    execSync( 'docker info' );
     10} catch ( e ) {
     11    if ( e.message.startsWith( 'Command failed: docker info' ) ) {
     12        throw new Error( 'Could not retrieve Docker system info. Is the Docker service running?' );
     13    }
     14
     15    throw e;
     16}
    617
    718// Start the local-env containers.
Note: See TracChangeset for help on using the changeset viewer.