Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Jan 19, 2024
1 parent de793d3 commit 885b9ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
11 changes: 2 additions & 9 deletions multiversx_sdk_cli/cli_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
import os
import sys
from pathlib import Path
from typing import Any

from multiversx_sdk_cli import cli_shared, config, utils
from multiversx_sdk_cli.ux import confirm_continuation

logger = logging.getLogger("cli.config")

Expand Down Expand Up @@ -106,13 +106,6 @@ def delete_config(args: Any):
logger.info(f"Config file not found. Aborting...")
return

confirm_continuation(config_file)
confirm_continuation(f"The file `{str(config_file)}` will be deleted. Do you want to continue? (y/n)")
os.remove(config_file)
logger.info("Successfully deleted the config file")


def confirm_continuation(file: Path):
answer = input(f"The file `{str(file)}` will be deleted. Do you want to continue? (y/n)")
if answer.lower().strip() not in ["y", "yes"]:
print("Confirmation not given. Stopping...")
exit(1)
7 changes: 7 additions & 0 deletions multiversx_sdk_cli/ux.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ def show_critical_error(message: str):

def show_warning(message: str):
print(Panel(f"[yellow]{escape(message)}"))


def confirm_continuation(message: str):
answer = input(message)
if answer.lower().strip() not in ["y", "yes"]:
print("Confirmation not given. Stopping...")
exit(1)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "multiversx-sdk-cli"
version = "9.3.1"
version = "9.4.0"
authors = [
{ name="MultiversX" },
]
Expand Down

0 comments on commit 885b9ea

Please sign in to comment.