diff --git a/Taskfile.yml b/Taskfile.yml index c85fd0ff..a92ac381 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -17,6 +17,10 @@ tasks: install: desc: Installs Task + details: | + Push Docker image to Google cloud registry. + + The env variable "DOCKER_IMAGE_FQN" define the Docker image name to push. cmds: - go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task env: diff --git a/internal/taskfile/task.go b/internal/taskfile/task.go index 4ebfd5e5..0bd63b26 100644 --- a/internal/taskfile/task.go +++ b/internal/taskfile/task.go @@ -1,6 +1,6 @@ package taskfile -// Tasks representas a group of tasks +// Tasks represents a group of tasks type Tasks map[string]*Task // Task represents a task @@ -9,6 +9,7 @@ type Task struct { Cmds []*Cmd Deps []*Dep Desc string + Details string Sources []string Generates []string Status []string diff --git a/task.go b/task.go index 8b222c84..11bac147 100644 --- a/task.go +++ b/task.go @@ -63,6 +63,18 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error { } } + if e.Details { + task := calls[0].Task + + if e.Taskfile.Tasks[task].Details == "" { + e.Logger.Errf("task: There is no detailed description for task: %s", task) + return nil + } + + e.Logger.Outf(e.Taskfile.Tasks[task].Details) + return nil + } + if e.Watch { return e.watchTasks(calls...) }