Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
working_path = options.working_path
new_version = options.new_version
interactive = options.interactive
only_patch = options.only_patch
dry_run = options.dry_run
config = parse_config(options.working_path)
# fmt: off
ui.info_1(
"Bumping from", ui.bold, config.current_version,
ui.reset, "to", ui.bold, new_version,
)
# fmt: on
git_bumper = GitBumper(working_path)
git_bumper.set_config(config)
git_state_error = None
try:
git_bumper.check_dirty() # Avoid data loss
if not only_patch:
git_bumper.check_branch_state(new_version)
except tbump.git.GitError as e:
if dry_run:
git_state_error = e
else:
raise
file_bumper = FileBumper(working_path)
file_bumper.set_config(config)
hooks_runner = HooksRunner(working_path, config.current_version)