Skip to content

Commit 0517b3e

Browse files
Sergio SisternesCopilot
andcommitted
fix: guard caret pin hint in plain-text fallback path
The Rich rendering path already guarded the caret pin hint with 'if latest_version:', but the plain-text fallback still used sorted_versions[0].version unconditionally, which could produce invalid specifiers like '#^nightly' for non-semver entries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d500d79 commit 0517b3e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/apm_cli/commands/view.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,11 @@ def _display_marketplace_versions(
353353
)
354354
click.echo("")
355355
click.echo(f" Install: apm install {plugin_name}@{marketplace_name}")
356-
click.echo(
357-
f" Pin: apm install {plugin_name}@{marketplace_name}"
358-
f"#^{sorted_versions[0].version}"
359-
)
356+
if latest_version:
357+
click.echo(
358+
f" Pin: apm install {plugin_name}@{marketplace_name}"
359+
f"#^{latest_version}"
360+
)
360361

361362

362363
def display_versions(package: str, logger: CommandLogger) -> None:

0 commit comments

Comments
 (0)