Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let shards build error if no targets defined #490

Conversation

straight-shoota
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member

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

@straight-shoota
Copy link
Member Author

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.

@straight-shoota straight-shoota merged commit e49b81c into crystal-lang:master Apr 9, 2021
@straight-shoota straight-shoota deleted the fix/shards-build-no-targets branch April 9, 2021 12:44
@straight-shoota straight-shoota added this to the v0.15.0 milestone Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants