File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 3434project_slug = '{{ cookiecutter.project_slug }}'
3535module_name = '{{ cookiecutter.module_name }}'
3636
37+ invalid_inputs = list ()
3738if not re .match (SLUG_REGEX , project_slug ):
3839 print ("ERROR: {} is not a valid slug! It may only consist of numbers and letters of the "
3940 "english alphabet, begin with a letter, and must use dashes instead of whitespace."
4041 .format (project_slug ))
41- sys . exit ( 1 )
42+ invalid_inputs . append ( "project_slug" )
4243
4344if not re .match (MODULE_REGEX , module_name ):
4445 print ("ERROR: {} is not a valid Python module name! "
4546 "See https://www.python.org/dev/peps/pep-0008/#package-and-module-names "
4647 "for naming standards." .format (module_name ))
48+ invalid_inputs .append ("module_name" )
49+
50+ if invalid_inputs :
51+ print ("\n You have entered invalid configuration values for: "
52+ "{}" .format (", " .join (invalid_inputs )))
53+ print ("\n Please fix your inputs in ~/.cookiecutter_replay/at-python-template.json" )
54+ print ("After that, rerun the template with: cookiecutter . --replay\n " )
4755 sys .exit (1 )
You can’t perform that action at this time.
0 commit comments