diff --git a/fastapi_template/template/hooks/post_gen_project.py b/fastapi_template/template/hooks/post_gen_project.py index 76f2399dbd03c38208de675c7afac7fa425aa89a..947991773e758fb295edb5460f84560fde613a57 100644 --- a/fastapi_template/template/hooks/post_gen_project.py +++ b/fastapi_template/template/hooks/post_gen_project.py @@ -8,7 +8,7 @@ from pygit2 import init_repository from termcolor import cprint, colored from pathlib import Path -MANIFEST = "conditional_files.json" +CONDITIONAL_MANIFEST = "conditional_files.json" REPLACE_MANIFEST = "replaceable_files.json" @@ -20,7 +20,7 @@ def delete_resource(resource): def delete_resources_for_disabled_features(): - with open(MANIFEST) as manifest_file: + with open(CONDITIONAL_MANIFEST) as manifest_file: manifest = json.load(manifest_file) for feature_name, feature in manifest.items(): if feature["enabled"].lower() != "true": @@ -31,7 +31,7 @@ def delete_resources_for_disabled_features(): print(text) for resource in feature["resources"]: delete_resource(resource) - delete_resource(MANIFEST) + delete_resource(CONDITIONAL_MANIFEST) cprint("cleanup complete!", color="green") @@ -49,6 +49,7 @@ def replace_resources(): for src_file in map(Path, replaces): if src_file.exists(): shutil.move(src_file, target_path) + delete_resource(REPLACE_MANIFEST) print( "Resources are happy to be where {}.".format( colored("they are needed the most", color="green", attrs=["underline"]) diff --git a/pyproject.toml b/pyproject.toml index 3d5e1e1d9b7406053c6b2cb81e70d99999c1c3bb..b49430cd31667dfa6a0b0859b2f4f5eb22a521b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fastapi_template" -version = "3.1.0" +version = "3.1.1" description = "Feature-rich robust FastAPI template" authors = ["Pavel Kirilin <win10@list.ru>"] packages = [{ include = "fastapi_template" }]