From 6b34808ef5964e8d19b6797caed42336fe920c87 Mon Sep 17 00:00:00 2001 From: Zipofar Date: Thu, 14 Dec 2023 18:45:48 +0300 Subject: [PATCH] [364] Update question and some refactor --- lib/uffizzi/cli/cluster.rb | 2 +- lib/uffizzi/cli/dev.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/uffizzi/cli/cluster.rb b/lib/uffizzi/cli/cluster.rb index 96c5ab6f..d4fa7c46 100644 --- a/lib/uffizzi/cli/cluster.rb +++ b/lib/uffizzi/cli/cluster.rb @@ -177,7 +177,7 @@ def handle_delete_command(command_args) end def handle_delete_dev_cluster(cluster_name) - question = 'You delete dev cluster. Continue?' + question = 'You are about to delete the dev cluster. Do you wish to proceed?' return unless Uffizzi.prompt.yes?(question) ClusterDeleteService.delete(cluster_name, cluster_api_connection_params) diff --git a/lib/uffizzi/cli/dev.rb b/lib/uffizzi/cli/dev.rb index cf727a94..c2d814bc 100644 --- a/lib/uffizzi/cli/dev.rb +++ b/lib/uffizzi/cli/dev.rb @@ -62,7 +62,7 @@ def handle_start_command(command_args) DevService.check_skaffold_config_existence(config_path) dev_cluster = DevService.account_user_project_dev_cluster(server, account_id, project_slug) - if try_to_start_second_dev_env?(dev_cluster) + if try_to_start_dev_env_for_existed_cluster?(dev_cluster) msg = 'Dev cluster already exists. ' \ "Before you create a new dev cluster, you must delete the existing one: $ uffizzi cluster delete #{dev_cluster[:name]}" Uffizzi.ui.say_error_and_exit(msg) @@ -214,7 +214,7 @@ def dev_cluster_already_deleted?(dev_cluster) DevService.dev_environment_exist? && dev_cluster.blank? end - def try_to_start_second_dev_env?(dev_cluster) + def try_to_start_dev_env_for_existed_cluster?(dev_cluster) !DevService.dev_environment_exist? && dev_cluster.present? end