mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
Refactor check_version function to accept a print_cmd argument and update print statements accordingly.
# Aider chat conversation:
This commit is contained in:
parent
fe9bcef676
commit
12cf19010f
1 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ from pathlib import Path
|
|||
|
||||
from aider.dump import dump
|
||||
|
||||
def check_version():
|
||||
def check_version(print_cmd):
|
||||
response = requests.get('https://pypi.org/pypi/aider-chat/json')
|
||||
data = response.json()
|
||||
latest_version = data['info']['version']
|
||||
|
@ -15,9 +15,9 @@ def check_version():
|
|||
if pkg_resources.parse_version(latest_version) <= pkg_resources.parse_version(current_version):
|
||||
return
|
||||
|
||||
print(f"Running aider version {current_version}, newer version available: {latest_version}")
|
||||
print_cmd(f"Newer version of `aider-chat` available: {latest_version}")
|
||||
py = Path(sys.executable).name
|
||||
print(f"To upgrade, run: {py} -m pip install --upgrade aider-chat")
|
||||
print_cmd(f"To upgrade, run: {py} -m pip install --upgrade aider-chat")
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_version()
|
||||
check_version(print)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue