Skip to content

Commit 6f53c9a

Browse files
authored
Merge pull request #212 from mrrobot47/add/mailhog-to-dev-local
Enable mailhog by default if dev/local
2 parents 8e4339e + fb40d67 commit 6f53c9a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/WordPress.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,12 @@ private function create_site( $assoc_args ) {
10691069
$cron_interval = rand( 0, 9 );
10701070
\EE::runcommand( 'cron create ' . $this->site_data['site_url'] . " --user=www-data --command='wp cron event run --due-now' --schedule='$cron_interval/10 * * * *'" );
10711071

1072+
$env_type = \EE::get_runner()->config['env'];
1073+
if ( ! empty( $env_type ) && in_array( $env_type, [ 'develop', 'development', 'local' ] ) ) {
1074+
\EE::log( 'Enabling mailhog as this is a ' . $env_type . ' server.' );
1075+
\EE::runcommand( 'mailhog enable ' . $this->site_data['site_url'] );
1076+
}
1077+
10721078
$this->info( [ $this->site_data['site_url'] ], [] );
10731079
}
10741080

0 commit comments

Comments
 (0)