Skip to content

Commit

Permalink
Workaround cookiecutter find_template taking 1 param instead of 2
Browse files Browse the repository at this point in the history
On older versions of cookiecutter (pre
cookiecutter/cookiecutter#1997) the
find.find_template function took one parameter but after that PR it
now takes two (in an apparent breaking change).
  • Loading branch information
LaurenceWarne committed Jul 20, 2024
1 parent db02e2b commit dbd17e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion prefab.el
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ import os.path
ctx = %s
envvars = ctx.get('cookiecutter', {}).get('_jinja2_env_vars', {})
env = StrictEnvironment(context=ctx, keep_trailing_newline=True, **envvars)
template_dir = find_template('%s', env)
template_dir_string = '%s'
try:
template_dir = find_template(template_dir_string, env)
except TypeError:
template_dir = find_template(template_dir_string)
dirname = os.path.split(template_dir)[1]
output_dir = '%s'
Expand Down

0 comments on commit dbd17e8

Please sign in to comment.