From 0ba0470adc315a617ecc120d7e6f4b0955cff7b7 Mon Sep 17 00:00:00 2001 From: aakrem Date: Mon, 13 May 2024 18:13:07 +0200 Subject: [PATCH] revert to initial solution --- agenta-cli/agenta/cli/variant_commands.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/agenta-cli/agenta/cli/variant_commands.py b/agenta-cli/agenta/cli/variant_commands.py index f25bbe3138..9835185cd8 100644 --- a/agenta-cli/agenta/cli/variant_commands.py +++ b/agenta-cli/agenta/cli/variant_commands.py @@ -104,12 +104,13 @@ def add_variant( ) if variant_name in config["variants"] and not overwrite: - overwrite_question = questionary.confirm( - "This variant already exists. Do you want to overwrite it?" - ).ask() - if not overwrite_question: - click.echo("Operation cancelled.") - sys.exit(0) + if not overwrite: + overwrite = questionary.confirm( + "This variant already exists. Do you want to overwrite it?" + ).ask() + if not overwrite: + click.echo("Operation cancelled.") + return try: click.echo( @@ -445,7 +446,6 @@ def remove_variant_cli(variant_name: str, app_folder: str): @click.option( "--overwrite", is_flag=True, - default=False, help="Overwrite the existing variant if it exists", ) @click.pass_context