Skip to content

Commit

Permalink
Avoid upgrade recommendation for bleeding edge users (ansible#2630)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Nov 11, 2022
1 parent a636401 commit cb5382f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/ansiblelint/__main__.py
Expand Up @@ -187,7 +187,9 @@ def main(argv: list[str] | None = None) -> int: # noqa: C901
console.print(
f"ansible-lint [repr.number]{__version__}[/] using ansible [repr.number]{ansible_version()}[/]"
)
console.print(get_version_warning())
msg = get_version_warning()
if msg:
console.print(msg)
sys.exit(0)

initialize_logger(options.verbosity)
Expand Down
6 changes: 3 additions & 3 deletions src/ansiblelint/config.py
Expand Up @@ -285,8 +285,8 @@ def get_version_warning() -> str:
elif current_version < new_version:
msg = f"""[warning]A new release of ansible-lint is available: [red]{current_version}[/] → [green][link={html_url}]{new_version}[/][/][/]"""

pip = guess_install_method()
if pip:
msg += f" Upgrade by running: [info]{pip}[/]"
pip = guess_install_method()
if pip:
msg += f" Upgrade by running: [info]{pip}[/]"

return msg

0 comments on commit cb5382f

Please sign in to comment.