Update __init__.py
This commit is contained in:
@@ -472,15 +472,11 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
|
|||||||
asset = matching_assets[0] if matching_assets else None
|
asset = matching_assets[0] if matching_assets else None
|
||||||
|
|
||||||
if asset is None:
|
if asset is None:
|
||||||
console.print(
|
console.print(f"[red]No matching release asset found[/red] for [bold]{ai_assistant}[/bold] (expected pattern: [bold]{pattern}[/bold])")
|
||||||
f"[red]No matching release asset found[/red] for AI assistant "
|
|
||||||
f"[bold]{ai_assistant}[/bold] (pattern: {pattern})"
|
|
||||||
)
|
|
||||||
asset_names = [a.get('name', '?') for a in assets]
|
asset_names = [a.get('name', '?') for a in assets]
|
||||||
console.print(Panel("\n".join(asset_names) or "(no assets)", title="Available Assets", border_style="yellow"))
|
console.print(Panel("\n".join(asset_names) or "(no assets)", title="Available Assets", border_style="yellow"))
|
||||||
raise typer.Exit(1)
|
raise typer.Exit(1)
|
||||||
|
|
||||||
# Use the resolved asset
|
|
||||||
download_url = asset["browser_download_url"]
|
download_url = asset["browser_download_url"]
|
||||||
filename = asset["name"]
|
filename = asset["name"]
|
||||||
file_size = asset["size"]
|
file_size = asset["size"]
|
||||||
@@ -489,14 +485,12 @@ def download_template_from_github(ai_assistant: str, download_dir: Path, *, scri
|
|||||||
console.print(f"[cyan]Found template:[/cyan] {filename}")
|
console.print(f"[cyan]Found template:[/cyan] {filename}")
|
||||||
console.print(f"[cyan]Size:[/cyan] {file_size:,} bytes")
|
console.print(f"[cyan]Size:[/cyan] {file_size:,} bytes")
|
||||||
console.print(f"[cyan]Release:[/cyan] {release_data['tag_name']}")
|
console.print(f"[cyan]Release:[/cyan] {release_data['tag_name']}")
|
||||||
|
|
||||||
# Download the file
|
|
||||||
zip_path = download_dir / filename
|
zip_path = download_dir / filename
|
||||||
if verbose:
|
if verbose:
|
||||||
console.print(f"[cyan]Downloading template...[/cyan]")
|
console.print(f"[cyan]Downloading template...[/cyan]")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Include auth header for initial GitHub request; it won't leak across cross-origin redirects
|
|
||||||
with client.stream(
|
with client.stream(
|
||||||
"GET",
|
"GET",
|
||||||
download_url,
|
download_url,
|
||||||
|
|||||||
Reference in New Issue
Block a user