From 27fbf59ba0fd5b18e382db2dfd3b6ed9bd3b7732 Mon Sep 17 00:00:00 2001 From: Anna Scholtz Date: Thu, 17 Nov 2022 01:59:41 -0800 Subject: [PATCH] Ensure target path exists when generating country_code_lookup (#3362) --- sql_generators/country_code_lookup/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sql_generators/country_code_lookup/__init__.py b/sql_generators/country_code_lookup/__init__.py index c02dd8acc0..6bb8593739 100644 --- a/sql_generators/country_code_lookup/__init__.py +++ b/sql_generators/country_code_lookup/__init__.py @@ -28,6 +28,7 @@ TEMPLATES_PATH = FILE_PATH / "templates" def generate(target_project, output_dir): """Generate a CSV that maps country aliases to a country code.""" target_path = Path(f"{output_dir}/{target_project}/static/country_names_v1/") + target_path.mkdir(parents=True, exist_ok=True) env = Environment(loader=FileSystemLoader(TEMPLATES_PATH)) csv_template = env.get_template("data.csv")