-
-
Notifications
You must be signed in to change notification settings - Fork 641
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
Regression: Piping to "task" command results in task: Missing schema version in Taskfile "__stdin__"
#1593
Comments
Looking at the code, it might be related to https://github.com/go-task/task/blob/main/taskfile/node.go#L33:
i.e. Task will try to read from |
Now I see that this is considered a feature (🤯) and there is no way to turn this off - it was introduced in #1483 I'd like to ask for a flag to turn this feature off. It prevents sub-commands executed from inside the Taskfile from being able to read input from stdin. |
task: Missing schema version in Taskfile "__stdin__"
task: Missing schema version in Taskfile "__stdin__"
Our temporary workaround for this (for tasks not expecting anything other than just to be invoked):
|
There's a couple of things here. Firstly, if a user specifies |
|
That won't solve the original problem, we want to be able to do:
Telling |
Not being able to pipe into task commands is a serious problem, would be great to see this fixed. We relied on this behaviour in several places, so this is a regression from our point of view. |
@amosshapira Apologies, I don't think my response was clear. I wasn't saying this exists now - I was saying this is probably how it should work.
Agreed. We should fix this.
This is an interesting idea. I quite like this. It would be interesting to gather opinions from those who originally requested the stdin functionality in #655. CC @brianbraunstein, @dAnjou, @mgbowman. For example, those users requested the ability to do
@aucampia Since this is causing issues with existing users, I'll reclassify this as a regression and we'll get a fix out as soon as we agree how to proceed. Draft PR with |
Should still work as intended. The bash redirect operator gets the Taskfile to STDIN all the same. |
It would satisfy my requirements. And as other already pointed out, it's a simple |
This should be fixed in the latest release (v3.37.0). Thanks to everyone for the feedback. |
The problem: If Task is executed with a pipeline as input, it tries to parse the input as a
Taskfile.yaml
format and fails.Here is a minimal
Taskfile.yaml
to demonstrate the issue:When executed normally, it does the expected and prints
hi
:When executed with any input via a pipeline, it prints an error and aborts:
When executed with some other input, it prints an error which could indicate that it expects a
Taskfile.yaml
format in its standard input?I tried to force it to read the
Taskfile.yaml
even if it's redundant but it does the same thing - it seems to expect aTaskfile.yaml
file format in its standard input:The text was updated successfully, but these errors were encountered: