varabyte / kobweb-cli

The CLI binary that drives the interactive Kobweb experience. See varabyte/kobweb
Apache License 2.0
10 stars 5 forks source link

Better experience for user who runs "kobweb run" in the wrong folder. #6

Closed bitspittle closed 7 months ago

bitspittle commented 9 months ago

A user ran kobweb run in the root of their new Kobweb project and got the error "This is not a Kobweb application module"

What the user needed to do was do: cd site; kobweb run (or kobweb run -p site) but they didn't realize that.

It would be nice to inform the user of their mistake more clearly than a generic error. Maybe something like.

This is not a Kobweb application module.

A Kobweb application module was found in the site/ subfolder. Consider navigating in there and running kobweb run again.

Note that...

  1. A project might have their kobweb application under a differently named subfolder.
  2. A project might have multiple kobweb applications in their project.

So on one end, we can just look for "site/.kobweb" and report if that is found, since that's 99.99% of all cases. Or we can do something more general and walk their directory structure, maybe max 1 or 2 levels deep, looking for .kobweb folders.

Then:

This is not a Kobweb application module.

A Kobweb application module was found in the app/ subfolder. Consider navigating in there and running kobweb run again.

or

This is not a Kobweb application module.

Kobweb application modules were found in the following folders:

  • site/free
  • site/paid

Consider navigating into one of them and running kobweb run again.

bitspittle commented 7 months ago

Will be fixed in 0.9.14