Fixed an issue with compatibility across cookiecutter versions
This commit is contained in:
1 parent
628b9edbab
commit
bc7b17b66f
1 file changed
+3
-5
@@ -83,17 +83,15 @@ class OctoPrintDevelCommands(click.MultiCommand):
|
||||
cookiecutter_dict = {}
|
||||
env = cookiecutter.prompt.Environment()
|
||||
|
||||
for key, raw in cookiecutter.prompt.iteritems(context['cookiecutter']):
|
||||
for key, raw in context['cookiecutter'].items():
|
||||
if key in options:
|
||||
val = options[key]
|
||||
else:
|
||||
raw = raw if cookiecutter.prompt.is_string(raw) else str(raw)
|
||||
raw = raw if isinstance(raw, basestring) else str(raw)
|
||||
val = env.from_string(raw).render(cookiecutter=cookiecutter_dict)
|
||||
|
||||
if not no_input:
|
||||
new_val = click.prompt(key, default=val)
|
||||
if new_val != "":
|
||||
val = new_val
|
||||
val = click.prompt(key, default=val)
|
||||
|
||||
cookiecutter_dict[key] = val
|
||||
return cookiecutter_dict
|
||||
|
||||
Reference in new issue
Block a user