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

Env: Only perform expensive install work when required #23809

Merged
merged 5 commits into from
Jul 14, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Move local config earlier
  • Loading branch information
noahtallen committed Jul 14, 2020
commit c47cebd4ffdfadb5c49eae60bf009d4d079009d8
16 changes: 8 additions & 8 deletions packages/env/lib/commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ module.exports = async function start( { spinner, debug, update } ) {

const config = await initConfig( { spinner, debug } );

if ( ! config.detectedLocalConfig ) {
const { configDirectoryPath } = config;
spinner.warn(
`Warning: could not find a .wp-env.json configuration file and could not determine if '${ configDirectoryPath }' is a WordPress installation, a plugin, or a theme.`
);
spinner.start();
}

// Check if the hash of the config has changed. If so, run configuration.
const configHash = md5( config );
const workDirectoryPath = config.workDirectoryPath;
Expand All @@ -73,14 +81,6 @@ module.exports = async function start( { spinner, debug, update } ) {
spinner.text = 'Downloading sources.';
}

if ( ! config.detectedLocalConfig ) {
const { configDirectoryPath } = config;
spinner.warn(
`Warning: could not find a .wp-env.json configuration file and could not determine if '${ configDirectoryPath }' is a WordPress installation, a plugin, or a theme.`
);
spinner.start();
}

await Promise.all( [
dockerCompose.upOne( 'mysql', {
config: config.dockerComposeConfigPath,
Expand Down