From 0bee68afee6ce971612772c2b905b1029814add8 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 21 Oct 2019 05:38:33 -0500 Subject: [PATCH] CLI: On disconnect, if the site is already disconnected, exit with a success (#13779) * CLI: On disconnect, if the site is already disconnected, exit with a success instead of a failure * Add a return --- class.jetpack-cli.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/class.jetpack-cli.php b/class.jetpack-cli.php index a17f9a8ee403c..d05cb7ca66570 100644 --- a/class.jetpack-cli.php +++ b/class.jetpack-cli.php @@ -183,7 +183,8 @@ public function test_connection( $args, $assoc_args ) { */ public function disconnect( $args, $assoc_args ) { if ( ! Jetpack::is_active() ) { - WP_CLI::error( __( 'You cannot disconnect, without having first connected.', 'jetpack' ) ); + WP_CLI::success( __( 'The site is not currently connected, so nothing to do!', 'jetpack' ) ); + return; } $action = isset( $args[0] ) ? $args[0] : 'prompt';