Skip to content

Commit

Permalink
Fix: Add functionality of force for go version (#604)
Browse files Browse the repository at this point in the history
* Fix: pontos-version golang for releases

* Refactor: Improve the logic of pontos-version go

* Fix: Add functionality of force for go version
  • Loading branch information
y0urself authored Feb 9, 2023
1 parent 51fbe6f commit ba49190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pontos/version/go.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def update_version(
git = Git()
current_version = git.list_tags(sort=TagSort.VERSION)[-1]

if not self.version_file_path.exists():
self.version_file_path.touch()
if not force and versions_equal(new_version, current_version):
return UpdatedVersion(previous=current_version, new=new_version)

self._update_version_file(new_version=new_version)

Expand Down
4 changes: 1 addition & 3 deletions pontos/version/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ def update_version(
# pyproject.toml
current_version = self._get_version_from_pyproject_toml()

if not self.version_file_path.exists():
self.version_file_path.touch()
elif not force and versions_equal(new_version, current_version):
if not force and versions_equal(new_version, current_version):
return UpdatedVersion(previous=current_version, new=new_version)

self._update_pyproject_version(new_version=new_version)
Expand Down

0 comments on commit ba49190

Please sign in to comment.