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

Interleaved output with pre/post tasks #1013

Open
krystian-panek-wttech opened this issue Feb 18, 2023 · 1 comment · May be fixed by #1327
Open

Interleaved output with pre/post tasks #1013

krystian-panek-wttech opened this issue Feb 18, 2023 · 1 comment · May be fixed by #1327
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@krystian-panek-wttech
Copy link

krystian-panek-wttech commented Feb 18, 2023

Hi! I am an owner/author of the tool - https://github.com/wttech/aemc and I am considering using your tool on top of mine.

I am trying to format the output of my tasks to be looking similar as before using your awesome Task tool.

basically, the effect I have now is:

image

I changed the green color to that purple one using env var.
But I also want to put the new line before running each task.

To see sth like this (now is doubled for some reason, single "\n" is more preferable):

image

I achieved that by:

output:
  group:
    end: "\n"

However, now e.g Docker (last lines) is no longer outputting colored text, and whole outputs are buffered and printed in the end of running each command. It's essential for me to not wait so long for outputs as I have very long running tasks and just the reason to switch interleaved output mode to grouped only because a need to print tasks outputs in groups separated by that new line is a bit cumbersome.

I am aware that I could add echo "" everywhere but that will not be so nice. But what if in Task we will have the option to define:

a) in my case... sth like this:

pre_task:
  cmds:
    - echo ""

b) or sb else could want even to have:

pre_task:
  cmds:
    - echo "started task '{{ .TASK }}'"

post_task:
  cmds:
    - echo "ended task '{{ .TASK }}' in {{ .ELAPSED_TIME }}"

also is it possible somehow to hide cmd displayed after task? I mean that one highlighted:

image

I have a quite long/multiline command and I am not sure if displaying it is beneficial

FYI for a many years before I was using Gradle for defining/running tasks. Now I was looking for light alternative and seems that Task might be a good option. Let's see ;)

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Feb 18, 2023
@krystian-panek-wttech
Copy link
Author

krystian-panek-wttech commented Feb 20, 2023

maybe just interleaved output could also automatically echo some strings before/after task execution?

output:
  interleaved:
    cmds_after:
      - echo ""

but it should not print task: [{{TASK}}] prefix automatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants