Skip to content

Commit

Permalink
Simplify update-docs-versions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rmisev committed Oct 31, 2023
1 parent ba4e9ff commit 0e05193
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tools/update-docs-versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ def main(versions_folder, git_ref):
if branch == "main":
update_ver(versions_path, branch, branch)
elif git_ref.startswith("refs/tags/"):
version = git_ref[10:]
if re.match(version_regex, version):
version_pieces = version.split(".")
dir = ".".join(version_pieces[:2])
ver = ".".join(version_pieces)
ver = git_ref[10:]
if re.match(version_regex, ver):
dir = ".".join(ver.split(".")[:2])
update_ver(versions_path, dir, ver)

def update_ver(versions_path, dir, ver):
Expand Down

0 comments on commit 0e05193

Please sign in to comment.