crystal-lang / shards

Dependency manager for the Crystal language
Other
763 stars 100 forks source link

Let `shards build` error if no targets defined #490

Closed straight-shoota closed 3 years ago

straight-shoota commented 3 years ago

If no targets are defined in shard.yml, the command shards build should fail with an error message instead of silently succeeding without actually building anything.

/cc https://forum.crystal-lang.org/t/trouble-with-building-shard/3122

asterite commented 3 years ago

What do you think of showing an example in the error message? It could check if src/name.cr exists and provide that as an example.

straight-shoota commented 3 years ago

Not sure that's a good idea. I'd usually recommend not to use the shard name as target file to allow easily requiring it as a dependency without starting the app.

asterite commented 3 years ago

Regardless, what do you think of showing how it's done in the error?

straight-shoota commented 3 years ago

I don't think there is yet any error message with detailed instructions in shards. Typically it just says s.th. like "run shards update first". But it's more complex with shard.yml configuration. Maybe we could reference man shard.yml. But it's bad UX if the manpage is missing.