Skip to content

Commit

Permalink
refactor(templates): Simplify target template file names with `post_g…
Browse files Browse the repository at this point in the history
…en_project.py` hook (#2061)

* refactor(templates): Simplify target template file names with post_gen_project.py hook

* Update cookiecutter/target-template/hooks/post_gen_project.py

---------

Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
  • Loading branch information
vicmattos and edgarrmondragon authored Nov 21, 2023
1 parent f087875 commit 669553e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cookiecutter/target-template/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
from pathlib import Path
import shutil


BASE_PATH = Path("{{cookiecutter.library_name}}")


if __name__ == "__main__":
if "{{ cookiecutter.license }}" != "Apache-2.0":
Path("LICENSE").unlink()

if "{{ cookiecutter.include_ci_files }}" != "GitHub":
shutil.rmtree(Path(".github"))

0 comments on commit 669553e

Please sign in to comment.