From 739c17bf4c65b7dd0ae1f6db8f5d7e21ca650dbf Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Thu, 23 Feb 2023 09:09:09 +0000 Subject: [PATCH] Initialize config when adding auth if non-existant --- devine/commands/auth.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devine/commands/auth.py b/devine/commands/auth.py index f18a615..e73b187 100644 --- a/devine/commands/auth.py +++ b/devine/commands/auth.py @@ -255,6 +255,8 @@ def add(ctx: click.Context, profile: str, service: str, cookie: Optional[str] = yaml, data = YAML(), None yaml.default_flow_style = False data = yaml.load(config_path) + if not data: + data = {} if "credentials" not in data: data["credentials"] = {} if service not in data["credentials"]: