clan_cli: create key directory
All checks were successful
checks / test (pull_request) Successful in 1m3s
checks-impure / test (pull_request) Successful in 1m50s

This commit is contained in:
kenji 2023-11-15 23:12:25 +01:00 committed by a-kenji
parent 5c495e3cdc
commit 12930b4057
No known key found for this signature in database

View File

@ -10,6 +10,8 @@ def generate_key() -> str:
if path.exists():
raise ClanError(f"Key already exists at {path}")
priv_key, pub_key = generate_private_key()
if not (parent := path.parent).exists():
parent.mkdir(parents=True, exist_ok=True)
path.write_text(priv_key)
return pub_key