mirror of https://github.com/devine-dl/devine.git
Initialize config when adding auth if non-existant
This commit is contained in:
parent
9932fa3f7a
commit
739c17bf4c
|
@ -255,6 +255,8 @@ def add(ctx: click.Context, profile: str, service: str, cookie: Optional[str] =
|
||||||
yaml, data = YAML(), None
|
yaml, data = YAML(), None
|
||||||
yaml.default_flow_style = False
|
yaml.default_flow_style = False
|
||||||
data = yaml.load(config_path)
|
data = yaml.load(config_path)
|
||||||
|
if not data:
|
||||||
|
data = {}
|
||||||
if "credentials" not in data:
|
if "credentials" not in data:
|
||||||
data["credentials"] = {}
|
data["credentials"] = {}
|
||||||
if service not in data["credentials"]:
|
if service not in data["credentials"]:
|
||||||
|
|
Loading…
Reference in New Issue