Skip to content

Commit

Permalink
Display module versions in cfbs status in addition to commit hashes
Browse files Browse the repository at this point in the history
Changelog: Title

Ticket: ENT-9556
Signed-off-by: jakub-nt <[email protected]>
  • Loading branch information
jakub-nt committed Jul 22, 2024
1 parent 95c5f62 commit 2fcaab5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cfbs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ def status_command() -> int:
if not modules:
return 0
print("\nModules:")
max_length = config.longest_module_key_length("name")
max_name_length = config.longest_module_key_length("name")
max_version_length = config.longest_module_key_length("version")
counter = 1
for m in modules:
if m["name"].startswith("./"):
Expand All @@ -312,8 +313,9 @@ def status_command() -> int:
path = get_download_path(m)
status = "Downloaded" if os.path.exists(path) else "Not downloaded"
commit = m["commit"]
name = pad_right(m["name"], max_length)
print("%03d %s @ %s (%s)" % (counter, name, commit, status))
name = pad_right(m["name"], max_name_length)
version = pad_right(m.get("version", ""), max_version_length)
print("%03d %s %s @ %s (%s)" % (counter, name, version, commit, status))
counter += 1

return 0
Expand Down

0 comments on commit 2fcaab5

Please sign in to comment.