Skip to content

Commit

Permalink
error if new version == current version
Browse files Browse the repository at this point in the history
  • Loading branch information
slashformotion committed Feb 25, 2024
1 parent 682aef6 commit 6dbad3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tbump/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 6dbad3e

Please sign in to comment.