-
Notifications
You must be signed in to change notification settings - Fork 663
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
elm make refuses to write to standard output #1918
Comments
Why are you interested in having the output go to stdout? Do you want JS or HTML? More details on the root motivation would be really helpful in assessing an ideas like this! |
Thanks for looking at this! This has come up for me a few times when I've been running Does (I also just wanted to say that I've really enjoyed working with Elm, and I especially appreciate the thoughtful and deliberate design approach you've taken both for the language itself and for the surrounding environment. Thank you for all of your work!) |
Yes, the file extension of So you basically want to keep the content of the file in memory and do some postprocessing? The only benefit I can think of (if I understood you) would be that you skip a write to disk? Anything else I'm missing? |
That's basically right. Keeping the output in memory can also make it easier to avoid overwriting old output until you know if the whole pipeline succeeds, but obviously that can be worked around. I guess another way to say mostly the same thing is that some interfaces (e.g. for other command-line tools) are oriented more toward piping stdin and stdout around than working with intermediate files. While it's always possible to bridge that gap, having to do so adds an inconvenience factor to those workflows. |
I can think of cases where I'd want this to produce JS, but are there cases where it'd make sense to produce HTML? I think it's worth brainstorming on that. From there, it'd need some special logic to avoid printing out progress when that kind of output is chosen. That probably should match what happens with |
Some ideas:
These ideas would be a step towards upholding the Unix principle "Expect the output of every program to become the input to another, as yet unknown, program." |
Another issue with the special handling of |
Quick Summary:
It would be nice for
elm make
to be able to write to standard output.SSCCE
Additional Details
I found the error message confusing, in that it was not clear why
--output=/dev/null
was ok but--output=/dev/stdout
was not. It looks like/dev/null
is treated as a special case here:compiler/builder/src/Generate/Output.hs
Lines 234 to 238 in 76e9079
Aside from potentially adding another case (e.g.
Stdout
), I think it would be helpful for the error message to be more explicit about the restrictions on<output-file>
values. I, at least, didn't manage to infer them correctly from the examples alone.The text was updated successfully, but these errors were encountered: