You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
I wrote a pre_gen_project hook for my cookiecutter template and I wish to check if there's not already a folder with same name as project prior to its creation.
I run Python v3.11 with cookiecutter v2.1.1
To begin with, something i note is that when i assign the result of os.getcwd() into a variable, it already reads the current path plus the project name by default.
Second, the piece of code doing the evaluation seems not to be executed at all. There is a regexp validation done on the folder name which works but the part for folder checking never evaluates to true though the hook exits with a failure.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone,
I wrote a pre_gen_project hook for my cookiecutter template and I wish to check if there's not already a folder with same name as project prior to its creation.
I run Python v3.11 with cookiecutter v2.1.1
To begin with, something i note is that when i assign the result of os.getcwd() into a variable, it already reads the current path plus the project name by default.
Second, the piece of code doing the evaluation seems not to be executed at all. There is a regexp validation done on the folder name which works but the part for folder checking never evaluates to true though the hook exits with a failure.
pre_gen_project code attached
snapshots.zip
pre_gen_project.txt
Beta Was this translation helpful? Give feedback.
All reactions