secrets/generate-private-key: just create parent opportunistically
This commit is contained in:
parent
2f870d2c83
commit
978d9efd7e
@ -10,8 +10,7 @@ def generate_key() -> str:
|
|||||||
if path.exists():
|
if path.exists():
|
||||||
raise ClanError(f"Key already exists at {path}")
|
raise ClanError(f"Key already exists at {path}")
|
||||||
priv_key, pub_key = generate_private_key()
|
priv_key, pub_key = generate_private_key()
|
||||||
if not (parent := path.parent).exists():
|
path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
parent.mkdir(parents=True, exist_ok=True)
|
|
||||||
path.write_text(priv_key)
|
path.write_text(priv_key)
|
||||||
return pub_key
|
return pub_key
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user