Skip to content

Commit

Permalink
chore: update the ask rpel
Browse files Browse the repository at this point in the history
  • Loading branch information
xianml committed Jul 18, 2024
1 parent a6a85cd commit 9152128
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/bentoml_cli/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,19 @@ def login(shared_options: SharedOptions, endpoint: str, api_token: str) -> None:
baseURL = f"{endpoint}/api_tokens"
encodedCallback = urllib.parse.quote(callback_server.callback_url)
authURL = f"{baseURL}?callback={encodedCallback}"
answer = Confirm.ask(
if Confirm.ask(
f"Press Enter to open [blue]{authURL}[/] in your browser..."
)
if not answer:
return
if webbrowser.open_new_tab(authURL):
rich.print(f"✅ Opened [blue]{authURL}[/] in your web browser.")
):
if webbrowser.open_new_tab(authURL):
rich.print(f"✅ Opened [blue]{authURL}[/] in your web browser.")
else:
rich.print(
f"🚨 Failed to open browser. Try create a new API token at {baseURL} or Open [blue]{authURL}[/] yourself"
)
else:
rich.print(
f"🚨 Failed to open browser. Try create a new API token at {baseURL}"
)
rich.print(f"🫱 Open [blue]{authURL}[/] yourself...")
try:
rich.print("🔒 Waiting for authentication...")
code = callback_server.wait_indefinitely_for_code()
if code is None:
raise ValueError(
Expand Down

0 comments on commit 9152128

Please sign in to comment.