facebookarchive / exerslide

A framework to create React-based HTML presentations and tutorials.
https://facebookincubator.github.io/exerslide/
Other
437 stars 46 forks source link

Handle project names with spaces #10

Open fkling opened 8 years ago

fkling commented 8 years ago

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.

hawkins commented 7 years ago

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?