Skip to content

Commit

Permalink
🎨 refactor(cli): improve update info and comment display
Browse files Browse the repository at this point in the history
Improved the display of update information and comments by adding
styling. Reordered the update check in the push command.
  • Loading branch information
sudoskys committed Oct 5, 2024
1 parent 535e73f commit c864f4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tsticker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ async def check_for_updates():
release_info = release_notes[0] if release_notes else {}
description = release_info.get('comment_text', '')
console.print(
f"INFO: tsticker {CURRENT_VERSION} is installed, while {latest_version} is available."
f"COMMENT: {description}" if description else ""
f"[bold yellow]INFO:[/] tsticker {CURRENT_VERSION} is installed, while {latest_version} is available."
)
if description:
console.print(f"[bold blue]COMMENT:[/]\n{description}")
except Exception as e:
console.print(f"[bold green]Skipping update check: {type(e)}[/]")

Expand Down Expand Up @@ -640,12 +641,12 @@ async def push_to_cloud(

@click.command()
async def push():
# 检查仓库更新
await check_for_updates()
"""Push local file changes to Telegram."""
pack, index_file, app = await upon_credentials()
if not pack or not index_file or not app:
return
# 检查仓库更新
await check_for_updates()
# 获取云端文件
with console.status("[bold yellow]Retrieving sticker...[/]", spinner='dots'):
try:
Expand Down

0 comments on commit c864f4f

Please sign in to comment.