moved licenses.json to avoid filepathing issues hopefully?

This commit is contained in:
alexzvk 2022-11-29 16:28:37 -05:00
parent 15109ab31e
commit b0699ce289
3 changed files with 2 additions and 2 deletions

View File

@ -331,7 +331,7 @@ def handle_licenses():
with open(os.path.join("licenses", "-temporary-placeholder.txt")) as f: with open(os.path.join("licenses", "-temporary-placeholder.txt")) as f:
selected_title = f.readline() 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) titles_dict = json.load(f)
# access the title to filename dictionary to find the correct file # access the title to filename dictionary to find the correct file
# using a dictionary instead of looping reduces time complexity # using a dictionary instead of looping reduces time complexity

View File

@ -28,7 +28,7 @@ def main() -> None:
(license_dir / file.name).write_text(replace_content_options(content)) (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 # 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) json.dump(titles_dict, licenses_dict, indent=2)
# Put "Not open source" at front so people know it's an option # Put "Not open source" at front so people know it's an option
front_options = [ front_options = [