Skip to content

Commit 50dd657

Browse files
committed
Update flow and warning to error
Signed-off-by: Riddhesh Sanghvi <riddheshsanghvi96@gmail.com>
1 parent 37b0dc9 commit 50dd657

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Admin_Tools_Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public function install() {
6161
EE::error( 'admin-tools file is empty. Can\'t proceed further.' );
6262
}
6363
$tools = json_decode( $tools_file, true );
64-
if ( empty( $tools ) ) {
65-
EE::error( 'No data found in admin-tools file. Can\'t proceed further.' );
66-
}
6764
$json_error = json_last_error();
6865
if ( $json_error != JSON_ERROR_NONE ) {
6966
EE::debug( 'Json last error: ' . $json_error );
7067
EE::error( 'Error decoding admin-tools file.' );
7168
}
69+
if ( empty( $tools ) ) {
70+
EE::error( 'No data found in admin-tools file. Can\'t proceed further.' );
71+
}
7272

7373
foreach ( $tools as $tool => $data ) {
7474
if ( ! $this->is_installed( $tool ) ) {
@@ -77,7 +77,7 @@ public function install() {
7777
if ( method_exists( $this, "install_$tool" ) ) {
7878
call_user_func_array( [ $this, "install_$tool" ], [ $data, $tool_path ] );
7979
} else {
80-
EE::warning( "No method found to install $tool. Skipping it." );
80+
EE::error( "No method found to install $tool. Aborting." );
8181
}
8282
EE::log( 'Done.' );
8383
} else {

0 commit comments

Comments
 (0)