mirror of
https://github.com/go-task/task.git
synced 2025-01-04 03:48:02 +02:00
renaming field in taskfile to summary
This commit is contained in:
parent
06d0af7a1d
commit
d05d418c4c
@ -9,7 +9,7 @@ type Task struct {
|
||||
Cmds []*Cmd
|
||||
Deps []*Dep
|
||||
Desc string
|
||||
Details string
|
||||
Summary string
|
||||
Sources []string
|
||||
Generates []string
|
||||
Status []string
|
||||
|
2
task.go
2
task.go
@ -83,7 +83,7 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
|
||||
|
||||
func (e *Executor) printTaskDetails(task string) {
|
||||
t := e.Taskfile.Tasks[task]
|
||||
s := t.Details
|
||||
s := t.Summary
|
||||
if s == "" {
|
||||
e.Logger.Errf("task: There is no detailed description for task: %s", task)
|
||||
return
|
||||
|
10
task_test.go
10
task_test.go
@ -555,20 +555,20 @@ func TestIncludesCallingRoot(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDetailsParsing(t *testing.T) {
|
||||
const dir = "testdata/details"
|
||||
const dir = "testdata/summary"
|
||||
|
||||
e := task.Executor{
|
||||
Dir: dir,
|
||||
}
|
||||
assert.NoError(t, e.Setup())
|
||||
|
||||
assert.Equal(t, e.Taskfile.Tasks["task-with-details"].Details, "details of task-with-details - line 1\nline 2\nline 3\n")
|
||||
assert.Equal(t, e.Taskfile.Tasks["other-task-with-details"].Details, "details of other-task-with-details")
|
||||
assert.Equal(t, e.Taskfile.Tasks["task-without-details"].Details, "")
|
||||
assert.Equal(t, e.Taskfile.Tasks["task-with-details"].Summary, "details of task-with-details - line 1\nline 2\nline 3\n")
|
||||
assert.Equal(t, e.Taskfile.Tasks["other-task-with-details"].Summary, "details of other-task-with-details")
|
||||
assert.Equal(t, e.Taskfile.Tasks["task-without-details"].Summary, "")
|
||||
}
|
||||
|
||||
func TestDetails(t *testing.T) {
|
||||
const dir = "testdata/details"
|
||||
const dir = "testdata/summary"
|
||||
|
||||
var buff bytes.Buffer
|
||||
e := task.Executor{
|
||||
|
@ -2,7 +2,7 @@ version: 2
|
||||
tasks:
|
||||
task-with-details:
|
||||
deps: [dependend-task-1,dependend-task-2]
|
||||
details: |
|
||||
summary: |
|
||||
details of task-with-details - line 1
|
||||
line 2
|
||||
line 3
|
||||
@ -25,12 +25,12 @@ tasks:
|
||||
- echo 'dependend-task-2 was executed'
|
||||
|
||||
other-task-with-details:
|
||||
details: details of other-task-with-details
|
||||
summary: details of other-task-with-details
|
||||
cmds:
|
||||
- echo 'other-task-with-details was executed'
|
||||
|
||||
task-with-description-containing-empty-line:
|
||||
details: |
|
||||
summary: |
|
||||
First line followed by empty line
|
||||
|
||||
Last Line
|
Loading…
Reference in New Issue
Block a user