mirror of
https://github.com/go-task/task.git
synced 2025-03-17 21:08:01 +02:00
refactoring
This commit is contained in:
parent
4b7f058f41
commit
c73ddc3552
16
task.go
16
task.go
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user