Skip to content

Commit

Permalink
Try fixing typing error by clarifying list-of-dicts parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Oct 17, 2023
1 parent 3d81425 commit 5c88dbf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions nf_core/components/components_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ def prompt_component_version_sha(
next_page_commits = []

choices = []
for title, sha in map(lambda commit: (commit["trunc_message"], commit["git_sha"]), commits):
display_color = "fg:ansiblue" if sha != installed_sha else "fg:ansired"
message = f"{title} {sha}"
if installed_sha == sha:
message += " (installed version)"
commit_display = [(display_color, message), ("class:choice-default", "")]
choices.append(questionary.Choice(title=commit_display, value=sha))
for commit in commits:
if commit:
title = commit["trunc_message"]
sha = commit["git_sha"]
display_color = "fg:ansiblue" if sha != installed_sha else "fg:ansired"
message = f"{title} {sha}"
if installed_sha == sha:
message += " (installed version)"
commit_display = [(display_color, message), ("class:choice-default", "")]
choices.append(questionary.Choice(title=commit_display, value=sha))
if next_page_commits:
choices += [older_commits_choice]
git_sha = questionary.select(
Expand Down

0 comments on commit 5c88dbf

Please sign in to comment.