Created
August 14, 2023 09:27
-
-
Save geoffreyvanwyk/8971c30710ca98ecc48ec4295735b6f0 to your computer and use it in GitHub Desktop.
Remove Jinja file extension after creating project from Cookiecutter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a "hooks" directory at the root of your Cookiecutter project, then add this file to it. | |
import os | |
for path, subdirs, files in os.walk("."): | |
for name in files: | |
if name.endswith(".j2"): | |
os.rename(os.path.join(path, name), os.path.join(path, name.rstrip(".j2"))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment