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:
|
try:
|
||||||
with open(config_file_path) as f:
|
with open(config_file_path) as f:
|
||||||
config: dict[str, Any] = yaml.safe_load(f)
|
config: dict[str, Any] = yaml.safe_load(f)
|
||||||
api_key = config.get("api", {}).get("key")
|
cloud_config = config.get("cloud", {})
|
||||||
email = config.get("user", {}).get("email")
|
api_key = cloud_config.get("api", {}).get("key")
|
||||||
|
email = cloud_config.get("user", {}).get("email")
|
||||||
|
|
||||||
if api_key and email:
|
if api_key and email:
|
||||||
console.print(
|
console.print(f"You're already logged in as {email}. ", style="bold green")
|
||||||
f"You're already logged in as {email}. "
|
|
||||||
f"Delete {config_file_path} to log in as a different user."
|
|
||||||
)
|
|
||||||
return True
|
return True
|
||||||
except yaml.YAMLError:
|
except yaml.YAMLError:
|
||||||
console.print(
|
console.print(
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ def login(
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if check_existing_login():
|
if check_existing_login():
|
||||||
|
console.print("Delete ~/.arcade/credentials.yaml to log in as a different user.\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Start the HTTP server in a new thread
|
# Start the HTTP server in a new thread
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue