Skip to content

Commit

Permalink
fix root version
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Aug 25, 2024
1 parent c8b1922 commit 69ca54b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doc/root_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@
git_submodule = subp.check_output(
["git", "submodule", "status"], cwd=project_dir
).decode()

for item in git_submodule.strip().split("\n"):
parts = item.split()
if PurePath(parts[1]) != PurePath("extern") / "root":
continue

assert len(parts) == 3, "module is not checked out"

root_version = parts[2][1:-1] # strip braces
print("ROOT", root_version)
break

# git submodule status does not yield the right state
# we must use git describe --tags
root_version = (
subp.check_output(
["git", "describe", "--tags"], cwd=project_dir / "extern" / "root"
)
.decode()
.strip()
)
print("ROOT", root_version)

0 comments on commit 69ca54b

Please sign in to comment.