1
0
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:
jaedle 2019-02-24 15:37:02 +01:00
parent 06d0af7a1d
commit d05d418c4c
6 changed files with 10 additions and 10 deletions

View File

@ -9,7 +9,7 @@ type Task struct {
Cmds []*Cmd
Deps []*Dep
Desc string
Details string
Summary string
Sources []string
Generates []string
Status []string

View File

@ -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

View File

@ -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{

View File

@ -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