diff --git a/cookiecutter/tap-template/hooks/post_gen_project.py b/cookiecutter/tap-template/hooks/post_gen_project.py index 62cd5425c..dee46e615 100644 --- a/cookiecutter/tap-template/hooks/post_gen_project.py +++ b/cookiecutter/tap-template/hooks/post_gen_project.py @@ -1,19 +1,11 @@ #!/usr/bin/env python from pathlib import Path +import shutil BASE_PATH = Path('{{cookiecutter.library_name}}') -def delete_folder(pth: Path): - for sub in pth.iterdir(): - if sub.is_dir(): - delete_folder(sub) - else: - sub.unlink() - pth.rmdir() - - if __name__ == '__main__': # Rename stream type client and delete others @@ -31,5 +23,5 @@ def delete_folder(pth: Path): Path('LICENSE').unlink() if '{{ cookiecutter.include_ci_files }}' != 'GitHub': - delete_folder(Path('.github')) + shutil.rmtree(Path('.github'))