Create parent dirs when adding cookies with auth add

Fixes #21.
This commit is contained in:
rlaphoenix 2023-02-07 21:21:15 +00:00
parent 0446c44a42
commit 6619c29fb5
1 changed files with 3 additions and 1 deletions

View File

@ -237,7 +237,9 @@ def add(ctx: click.Context, profile: str, service: str, cookie: Optional[str] =
log.info("Skipped adding a Credential...")
if cookie:
cookie = cookie.rename((config.directories.cookies / service / profile).with_suffix(".txt"))
final_path = (config.directories.cookies / service / profile).with_suffix(".txt")
final_path.parent.mkdir(parents=True, exist_ok=True)
cookie = cookie.rename(final_path)
log.info(f"Moved Cookie file to: {cookie}")
if credential: