mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
fix: Add verbose output for version check
This commit is contained in:
parent
76a4b878b1
commit
ad16cc3c41
1 changed files with 7 additions and 2 deletions
|
@ -16,6 +16,9 @@ def check_version(io, just_check=False, verbose=False):
|
||||||
day = 60 * 60 * 24
|
day = 60 * 60 * 24
|
||||||
since = time.time() - fname.stat().st_mtime
|
since = time.time() - fname.stat().st_mtime
|
||||||
if since < day:
|
if since < day:
|
||||||
|
if verbose:
|
||||||
|
hours = since / 60 / 60
|
||||||
|
io.tool_output(f"Too soon to check version: {hours:.1f} hours")
|
||||||
return
|
return
|
||||||
|
|
||||||
# To keep startup fast, avoid importing this unless needed
|
# To keep startup fast, avoid importing this unless needed
|
||||||
|
@ -27,7 +30,7 @@ def check_version(io, just_check=False, verbose=False):
|
||||||
latest_version = data["info"]["version"]
|
latest_version = data["info"]["version"]
|
||||||
current_version = aider.__version__
|
current_version = aider.__version__
|
||||||
|
|
||||||
if just_check:
|
if just_check or verbose:
|
||||||
io.tool_output(f"Current version: {current_version}")
|
io.tool_output(f"Current version: {current_version}")
|
||||||
io.tool_output(f"Latest version: {latest_version}")
|
io.tool_output(f"Latest version: {latest_version}")
|
||||||
|
|
||||||
|
@ -41,11 +44,13 @@ def check_version(io, just_check=False, verbose=False):
|
||||||
fname.parent.mkdir(parents=True, exist_ok=True)
|
fname.parent.mkdir(parents=True, exist_ok=True)
|
||||||
fname.touch()
|
fname.touch()
|
||||||
|
|
||||||
if just_check:
|
if just_check or verbose:
|
||||||
if is_update_available:
|
if is_update_available:
|
||||||
io.tool_output("Update available")
|
io.tool_output("Update available")
|
||||||
else:
|
else:
|
||||||
io.tool_output("No update available")
|
io.tool_output("No update available")
|
||||||
|
|
||||||
|
if just_check:
|
||||||
return is_update_available
|
return is_update_available
|
||||||
|
|
||||||
if not is_update_available:
|
if not is_update_available:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue