From c877263611d8461ea9bc923f3a4ee7c890f9b458 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Tue, 26 Sep 2023 07:36:35 -0300 Subject: [PATCH] Creates deployment/secrets Directory If Not Exists --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b332109..cd865f1 100644 --- a/setup.py +++ b/setup.py @@ -152,9 +152,11 @@ def validate_env(env: dict): def write_secrets_to_file(env: dict): for key, secret in env.items(): - dir = Path("deployment", "secrets") + secrets_dir = Path("deployment", "secrets") + if not secrets_dir.exists(): + secrets_dir.mkdir() - with open(dir.joinpath(f"{key}.json"), "w") as f: + with open(secrets_dir.joinpath(f"{key}.json"), "w") as f: json.dump(secret, f, indent=4)