1
0
mirror of https://github.com/go-task/task.git synced 2025-03-17 21:08:01 +02:00

refactoring

This commit is contained in:
jaedle 2019-02-24 09:27:26 +01:00
parent 4b7f058f41
commit c73ddc3552

16
task.go
View File

@ -64,13 +64,7 @@ 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)
} else {
e.Logger.Outf(e.Taskfile.Tasks[task].Details)
}
displayTaskDetails(e, calls[0].Task)
return nil
}
@ -86,6 +80,14 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
return nil
}
func displayTaskDetails(e *Executor, task string) {
if e.Taskfile.Tasks[task].Details == "" {
e.Logger.Errf("task: There is no detailed description for task: %s", task)
} else {
e.Logger.Outf(e.Taskfile.Tasks[task].Details)
}
}
// Setup setups Executor's internal state
func (e *Executor) Setup() error {
var err error