-
Notifications
You must be signed in to change notification settings - Fork 842
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
edge cases in broken templates give odd errors #1535
Comments
Makes sense to me, seems like a good thing to fix. |
I've got a fix for the first part (give a better error in case of a blank template) in 019dd75, I'm not entirely sure what to do about a missing .cabal file though. Options I can think of:
I am not really sure what the desired outcome should be here, anyone have any thoughts? I originally thought it should just be an error, but I'm starting to wonder what it would actually hurt allowing that. |
I'm in favor of option (1). My reasoning for each option: (1) Seems fine, since it's unlikely that templates will intentionally lack a cabal file |
Sounds like good reasoning to me, thanks. |
These are rather dumb, but I could still see them coming up in practice and it might not be the worst idea to handle them:
Blank Template
Steps to Reproduce
Expected
An error message about the template being empty.
Template without .cabal
Steps to Reproduce
Expected
Either an
init
ed package or (since that's probably not really sane without a .cabal file) a better error message about the template being broken. Edit: I just noticed that it works file with an empty .cabal file, so maybe it would make sense for stack.yaml to do the same thing when .cabal doesn't exist?In particular it's kind of amusing, but not really helpful, that it tells you to run "stack new" when that's what you just tried.
If there's a real use for a template that doesn't include a .cabal file (I can't think of one, but maybe someone else can), it might be acceptable to just have a big warning about why init didn't do anything, and ideally remove the suggestion about "stack new".
Version
The text was updated successfully, but these errors were encountered: