From a344cc0a8b8edea0d8f00271875eb3bfb4677e23 Mon Sep 17 00:00:00 2001 From: Eric Gustin <34000337+EricGustin@users.noreply.github.com> Date: Thu, 30 Jan 2025 09:51:57 -0800 Subject: [PATCH] Use cross platform paths (#237) # PR Description Tiny PR to use `os.path.join` instead of hardcoding paths with forward slashes. --- arcade/arcade/cli/authn.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arcade/arcade/cli/authn.py b/arcade/arcade/cli/authn.py index ac0d80f2..90ea5fa5 100644 --- a/arcade/arcade/cli/authn.py +++ b/arcade/arcade/cli/authn.py @@ -58,11 +58,12 @@ class LoginCallbackHandler(BaseHTTPRequestHandler): # ensure the ~/.arcade directory exists # TODO: this should use WORK_DIR from env if set - if not os.path.exists(os.path.expanduser("~/.arcade")): - os.makedirs(os.path.expanduser("~/.arcade"), exist_ok=True) + arcade_dir = os.path.join(os.path.expanduser("~"), ".arcade") + if not os.path.exists(arcade_dir): + os.makedirs(arcade_dir, exist_ok=True) # TODO don't overwrite existing config - config_file_path = os.path.expanduser("~/.arcade/credentials.yaml") + config_file_path = os.path.join(arcade_dir, "credentials.yaml") new_config = {"cloud": {"api": {"key": api_key}, "user": {"email": email}}} with open(config_file_path, "w") as f: yaml.dump(new_config, f)