fix: No output from arcade login when already logged in (#143)
I ran into this and was scratching my head why `arcade login` was exiting with no output. Fix: Get config data from the new top-level object we introduced.
This commit is contained in:
parent
aff7350eec
commit
1fdf982238
2 changed files with 5 additions and 6 deletions
|
|
@ -133,14 +133,12 @@ def check_existing_login() -> bool:
|
|||
try:
|
||||
with open(config_file_path) as f:
|
||||
config: dict[str, Any] = yaml.safe_load(f)
|
||||
api_key = config.get("api", {}).get("key")
|
||||
email = config.get("user", {}).get("email")
|
||||
cloud_config = config.get("cloud", {})
|
||||
api_key = cloud_config.get("api", {}).get("key")
|
||||
email = cloud_config.get("user", {}).get("email")
|
||||
|
||||
if api_key and email:
|
||||
console.print(
|
||||
f"You're already logged in as {email}. "
|
||||
f"Delete {config_file_path} to log in as a different user."
|
||||
)
|
||||
console.print(f"You're already logged in as {email}. ", style="bold green")
|
||||
return True
|
||||
except yaml.YAMLError:
|
||||
console.print(
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ def login(
|
|||
"""
|
||||
|
||||
if check_existing_login():
|
||||
console.print("Delete ~/.arcade/credentials.yaml to log in as a different user.\n")
|
||||
return
|
||||
|
||||
# Start the HTTP server in a new thread
|
||||
|
|
|
|||
Loading…
Reference in a new issue