Skip to content

Commit

Permalink
Fix: Version Pattern for Java Version Command
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself authored Aug 22, 2023
1 parent 6083b37 commit 093bddd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pontos/version/commands/_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
__version__ = "{}"\n"""

VERSION_PATTERN = (
r"([0-9]+\.[0-9]+\.[0-9]+(-?([ab]|rc|alpha|beta)[0-9]+(.dev[0-9]+)?)?)"
)


def find_file(
filename: Path, search_path: str, search_glob: str
Expand Down Expand Up @@ -125,8 +129,7 @@ def _update_properties_file(
# skip if not existing
return
pattern = (
r"sentry\.release=([0-9]+\.[0-9]+\.[0-9]+"
r"(-?([ab]|dev|rc|alpha|beta)[0-9]+)?)"
rf"sentry\.release={version_pattern}"
)
replace_string_in_file(
self._properties_file_path,
Expand All @@ -148,8 +151,7 @@ def _update_swagger_config(
# skip if not existing
return
pattern = (
r'\.version\("([0-9]+\.[0-9]+\.[0-9]+'
r'(-?([ab]|dev|rc|alpha|beta)[0-9]+)?)"\)'
rf'\.version\("{VERSION_PATTERN}"\)'
)
replace_string_in_file(
swagger_config_file, pattern=pattern, replacement=str(new_version)
Expand Down

0 comments on commit 093bddd

Please sign in to comment.