normalize package names for templates

This commit is contained in:
evilchili 2024-04-12 10:52:14 -07:00
parent 73fc992b8f
commit 232bc5044b

View File

@ -78,10 +78,11 @@ def new(
""" """
Initialize a project with boilerplate code. Initialize a project with boilerplate code.
""" """
package_name = project_name.lower().replace('-', '_')
tmpl = templates()[template.name] tmpl = templates()[template.name]
tmpl.values = { tmpl.values = {
'PROJECT_NAME': project_name, 'PROJECT_NAME': project_name,
'PACKAGE_NAME': project_name, 'PACKAGE_NAME': package_name,
'DESCRIPTION': f"{project_name}: automatically generated by poetry-slam.", 'DESCRIPTION': f"{project_name}: automatically generated by poetry-slam.",
'AUTHOR_NAME': os.environ['USER'] 'AUTHOR_NAME': os.environ['USER']
} }