From 6dbad3e922e03f9650307a3c0f97b1468e22fa5e Mon Sep 17 00:00:00 2001 From: slashformotion Date: Sun, 25 Feb 2024 13:05:29 +0100 Subject: [PATCH] error if new version == current version --- tbump/cli.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tbump/cli.py b/tbump/cli.py index d554796..4cc5687 100644 --- a/tbump/cli.py +++ b/tbump/cli.py @@ -208,6 +208,13 @@ def run_bump( bump(bump_options, _construct_operations(arguments)) +class NotANewVersion(Error): + def __init__(self): + super().__init__() + + def print_error(self) -> None: + ui.error("New version is the same as the previous one") + def bump(options: BumpOptions, operations: List[str]) -> None: working_path = options.working_path new_version = options.new_version @@ -220,6 +227,9 @@ def bump(options: BumpOptions, operations: List[str]) -> None: ) config = config_file.get_config() + if config.current_version == new_version: + raise NotANewVersion() + # fmt: off ui.info_1( "Bumping from", ui.bold, config.current_version,