go-task / task

A task runner / simpler Make alternative written in Go
https://taskfile.dev
MIT License
11.04k stars 587 forks source link

Suppress signal received message #1621

Open sedyh opened 4 months ago

sedyh commented 4 months ago

Hello, I would like to be able to turn off stdout for a task using an option in the taskfile, I have not found such functionality or existing proposals.

It would be nice if silent not only did not output the command, but also did not write about received signals until it is stderr.

version: "3"

silent: true

tasks:
  app:
    cmds:
      - cmd: go build -ldflags="-X main.Version={{.VERSION}}" -o app ./cmd/app && ./app
        ignore_error: true
      - defer: rm -rf app
started
log
log
...
log
task: Signal received: "interrupt"
stopped
pd93 commented 4 months ago

I have thought about this in the past. It occurs to me that our silent actually works very similarly to other CLI's quiet (e.g. docker). I think that silent is somewhat of a misnomer.

I've considered opening a proposal for an experiment that will change the behaviour of silent to be actually silent as proposed here and to add a new quiet flag/field that will maintain the existing behaviour of silent.

However, there is definitely a balance to strike here between "fixing" these issues and limiting the number of changes a user needs to make to migrate their Taskfiles to any potential future major release.

sedyh commented 2 weeks ago

Hello. Has anything similar been added recently? Can I make a PR for this?