Skip to content

Commit 829fb33

Browse files
committed
Skip checks and migrations on 'ee help' and 'ee cli' commands
Signed-off-by: Riddhesh Sanghvi <[email protected]>
1 parent 7bff0c1 commit 829fb33

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

php/EE/Runner.php

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,6 @@ public function __get( $key ) {
5151
*/
5252
private function init_ee() {
5353

54-
// Minimum requirement checks.
55-
$docker_running = 'docker ps > /dev/null';
56-
if ( ! EE::exec( $docker_running ) ) {
57-
EE::error( 'docker not installed or not running.' );
58-
}
59-
60-
$docker_compose_installed = 'command -v docker-compose > /dev/null';
61-
if ( ! EE::exec( $docker_compose_installed ) ) {
62-
EE::error( 'EasyEngine requires docker-compose.' );
63-
}
64-
65-
if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) {
66-
EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' );
67-
}
68-
6954
$this->ensure_present_in_config( 'locale', 'en_US' );
7055
$this->ensure_present_in_config( 'ee_installer_version', 'stable' );
7156

@@ -76,7 +61,30 @@ private function init_ee() {
7661
if ( ! is_dir( $db_dir ) ) {
7762
mkdir( $db_dir );
7863
}
79-
$this->maybe_trigger_migration();
64+
65+
if (
66+
! empty( $this->arguments ) &&
67+
( ! in_array( $this->arguments[0], [ 'cli', 'help' ], true ) ||
68+
$this->arguments === [ 'cli', 'update' ] )
69+
) {
70+
71+
// Minimum requirement checks.
72+
$docker_running = 'docker ps > /dev/null';
73+
if ( ! EE::exec( $docker_running ) ) {
74+
EE::error( 'docker not installed or not running.' );
75+
}
76+
77+
$docker_compose_installed = 'command -v docker-compose > /dev/null';
78+
if ( ! EE::exec( $docker_compose_installed ) ) {
79+
EE::error( 'EasyEngine requires docker-compose.' );
80+
}
81+
82+
if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) {
83+
EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' );
84+
}
85+
86+
$this->maybe_trigger_migration();
87+
}
8088
}
8189

8290
/**

0 commit comments

Comments
 (0)