exerslide
exerslide copied to clipboard
Handle project names with spaces
If exerslide init
is run as
exerslide init "My Project Name"
it will fail silently. It looks like everything will have installed fine but that's not the case. That's because the project name is used in the package.json
's name
field which doesn't allow spaces, so npm refuses to install any dependencies.
The name is also used in other places where spaces (and other characters) are not valid.
Proposed solution
Use the passed name only as the <title>
in the index.html
in the HTML template. For all other cases, use the current directory name.
npm packages typically use a hyphen where a space might otherwise be. Why not swap all spaces for hyphens for the package.json
's name
, and wherever else spaces aren't allowed?