Update cli/utils.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Michael Liu 2026-03-23 15:38:10 +00:00 committed by GitHub
parent b0754b3e39
commit 6d3b19d705
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -374,9 +374,13 @@ def perform_copilot_oauth() -> bool:
console.print("[red]GitHub authentication skipped. Exiting...[/red]")
return False
result = subprocess.run(["gh", "auth", "login"])
if result.returncode != 0:
console.print("[red]`gh auth login` failed.[/red]")
try:
result = subprocess.run(["gh", "auth", "login"])
if result.returncode != 0:
console.print("[red]`gh auth login` failed.[/red]")
return False
except FileNotFoundError:
console.print("[red]Error: `gh` command not found. Please install the GitHub CLI.[/red]")
return False
if check_copilot_auth():