From b0699ce289f60406c950204fe0a14c2c0468afc9 Mon Sep 17 00:00:00 2001 From: alexzvk Date: Tue, 29 Nov 2022 16:28:37 -0500 Subject: [PATCH] moved licenses.json to avoid filepathing issues hopefully? --- hooks/post_gen_project.py | 2 +- scripts/update_licenses.py | 2 +- .../licenses/licenses.json | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename licenses.json => {{cookiecutter.project_slug}}/licenses/licenses.json (100%) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 3a908a52d..996f57611 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -331,7 +331,7 @@ def handle_licenses(): with open(os.path.join("licenses", "-temporary-placeholder.txt")) as f: selected_title = f.readline() - with open(os.path.join("/", "licenses.json")) as f: + with open(os.path.join("licenses", "licenses.json")) as f: titles_dict = json.load(f) # access the title to filename dictionary to find the correct file # using a dictionary instead of looping reduces time complexity diff --git a/scripts/update_licenses.py b/scripts/update_licenses.py index 66146e110..0cc680b35 100644 --- a/scripts/update_licenses.py +++ b/scripts/update_licenses.py @@ -28,7 +28,7 @@ def main() -> None: (license_dir / file.name).write_text(replace_content_options(content)) # write the titles dictionary to a json file and put it in workflows so it can be accessed by other files - with open('licenses.json', 'w') as licenses_dict: + with open('{{cookiecutter.project_slug}}/licenses/licenses.json', 'w') as licenses_dict: json.dump(titles_dict, licenses_dict, indent=2) # Put "Not open source" at front so people know it's an option front_options = [ diff --git a/licenses.json b/{{cookiecutter.project_slug}}/licenses/licenses.json similarity index 100% rename from licenses.json rename to {{cookiecutter.project_slug}}/licenses/licenses.json