Browse Source

fix: `shore new` command now replaces hyphens with underscores for the created filenames (closes #21)

master
Niklas Rosenstein 6 months ago
parent
commit
58c799161f
Signed by: NiklasRosenstein <rosensteinniklas@gmail.com> GPG Key ID: 06D269B33D25F6C6
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/shore/__main__.py

+ 2
- 1
src/shore/__main__.py View File

@@ -174,7 +174,8 @@ def new(**args):
# Render the template files to the target directory.
for source_filename in walk_package_resources('shore', template_path):
# Expand variables in the filename.
filename = _render_template(source_filename, name=name_on_disk.replace('.', '/'))
name = name_on_disk.replace('-', '_').replace('.', '/')
filename = _render_template(source_filename, name=name)
dest = os.path.join(args['directory'], filename)
yield FileToRender(
None,


Loading…
Cancel
Save