From c8ffe4991b6bd78d447655dd0bbf6960ddeac218 Mon Sep 17 00:00:00 2001 From: Veivel <25278964+Veivel@users.noreply.github.com> Date: Mon, 17 Jun 2024 20:57:06 +0700 Subject: [PATCH] fix: .env path --- deploy-stg/infisical.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deploy-stg/infisical.py b/deploy-stg/infisical.py index 9afa795..d3a1d01 100644 --- a/deploy-stg/infisical.py +++ b/deploy-stg/infisical.py @@ -62,14 +62,15 @@ f"infisical export --projectId {project_id} --env {env} --path {path}".split( " " ), - stdout=open(Path("deploy-stg") / ".env", "w"), + stdout=open(Path(".") / ".env", "w"), stderr=sys.stderr, ) # Strip quotes if not quoted (Infisical exports for .env by default is quoted) if not quoted: + logger.info("Exports are quoted. Running alt logic") # Read each variable and strip the quotes - with open(Path("deploy-stg") / ".env", "r+") as secret_envs: + with open(Path(".") / ".env", "r+") as secret_envs: quoted_vars = [] for secret in secret_envs: secret = secret.strip() @@ -81,6 +82,6 @@ quoted_vars.append(f"{key}={value}") # Write the contents of quoted vars to the .env file - with open(Path("deploy-stg") / ".env", "w+") as env_file: + with open(Path(".") / ".env", "w+") as env_file: for var in quoted_vars: env_file.write(var + "\n") \ No newline at end of file