-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
Override silent
option when calling other tasks
#680
Comments
I had a similar use case. I want to run have a task for pull docker containers with optional I tried to make it work with vars docker-pull:
run: when_changed
- cmd: docker pull {{.DOCKER_IMAGE}}
ignore_error: '{{.IGNORE_ERROR | default false}}' The solution above was silently failing. It seems When using docker-pull:
run: when_changed
cmds:
- docker pull {{.DOCKER_IMAGE}}
ignore_error: '{{.IGNORE_ERROR | default false}}'
silent: '{{.SILENT | default false}}' I get an type error:
|
#363 similar functionality, but for |
I have a similar use case, but using When the calling taskfile has version: '3'
silent: false If an included taskfile has: version: '3'
silent: true Then output is displayed, where I expect the included files Swapping them over; calling task is I'm not sure how the |
I'm considering looking at this after #546 It feels like something where it makes sense to handle both As far as I can tell it will require us to widen the Call interface used for calling a task. Seem like this is the place where a Task calls another Task. The change seems simple on the surface, but it also feels like a change that needs to be implemented more than one place ... |
Hey @danquah, Feel free to take this issue. Yes, it does indeed makes sense implement both I believe it should be a relatively simple thing to implement. |
Sounds good - I'll probably work on it this coming week |
Done some initial work on the issue now. The final changes are not going to be too complicated, but there are a couple of important decisions that has to be made
None of these are blockers, I'll chuck along - but if you have time I would appreciate a yay/nay on whether hooking this in already in up in |
Hi @danquah, Some comments: I think that NOT having inheritance for these flags would probably be more consistent with how Task work overall. I agree that working on |
Still working on this - getting close, I have a quick question. First a quick reflection: The logic for when something should go silent starts to get a bit complex. I it's ok as long as you just stick to a single strategy for how to silence things - but when you mix the options up things starts to get complicated. The thing that confused me the most even during implementation is the difference between silencing Task (ie, stop outputting "task: [some task] some command") and silencing the actual output from the command (ie, stop output from "echo 'hello world'"). We support silencing task itself, but not silencing the commands. OK, now for the question. What takes precedence here? task-test-chatty-calls-silenced-cmd:
silent: false
cmds:
- cmd: exit 0
silent: true I'm thinking the |
Just my opinions and by no means the final answers:
This makes sense to me. Task is adding additional text to the output from commands which might not always be desirable. We need to be able to disable this independently of silencing command output. Silencing command output is already a feature of most (all?) shells using redirection. e.g.
I agree with you that the command should take precedence. We should override when being more specific. It would be very confusing to have |
I agree with Pete comments. |
Ok, draft PR time #1142 I'll finish off tomorrow by adding documentation of the new |
PR is ready for review now. |
This does not as expected:
For comparison, this is what I expected to see:
It would be really good if it worked, for the cases where one might want the called task to not be silent when executed directly, but be silent when executed from another task.
I know there's the
-s
flag, but it wouldn't work for the case where one might want the other cmds to not be silent.The text was updated successfully, but these errors were encountered: