mirror of
https://github.com/go-task/task.git
synced 2025-02-01 13:17:56 +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
|
Cmds []*Cmd
|
||||||
Deps []*Dep
|
Deps []*Dep
|
||||||
Desc string
|
Desc string
|
||||||
Details string
|
Summary string
|
||||||
Sources []string
|
Sources []string
|
||||||
Generates []string
|
Generates []string
|
||||||
Status []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) {
|
func (e *Executor) printTaskDetails(task string) {
|
||||||
t := e.Taskfile.Tasks[task]
|
t := e.Taskfile.Tasks[task]
|
||||||
s := t.Details
|
s := t.Summary
|
||||||
if s == "" {
|
if s == "" {
|
||||||
e.Logger.Errf("task: There is no detailed description for task: %s", task)
|
e.Logger.Errf("task: There is no detailed description for task: %s", task)
|
||||||
return
|
return
|
||||||
|
10
task_test.go
10
task_test.go
@ -555,20 +555,20 @@ func TestIncludesCallingRoot(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDetailsParsing(t *testing.T) {
|
func TestDetailsParsing(t *testing.T) {
|
||||||
const dir = "testdata/details"
|
const dir = "testdata/summary"
|
||||||
|
|
||||||
e := task.Executor{
|
e := task.Executor{
|
||||||
Dir: dir,
|
Dir: dir,
|
||||||
}
|
}
|
||||||
assert.NoError(t, e.Setup())
|
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["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"].Details, "details of other-task-with-details")
|
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"].Details, "")
|
assert.Equal(t, e.Taskfile.Tasks["task-without-details"].Summary, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDetails(t *testing.T) {
|
func TestDetails(t *testing.T) {
|
||||||
const dir = "testdata/details"
|
const dir = "testdata/summary"
|
||||||
|
|
||||||
var buff bytes.Buffer
|
var buff bytes.Buffer
|
||||||
e := task.Executor{
|
e := task.Executor{
|
||||||
|
@ -2,7 +2,7 @@ version: 2
|
|||||||
tasks:
|
tasks:
|
||||||
task-with-details:
|
task-with-details:
|
||||||
deps: [dependend-task-1,dependend-task-2]
|
deps: [dependend-task-1,dependend-task-2]
|
||||||
details: |
|
summary: |
|
||||||
details of task-with-details - line 1
|
details of task-with-details - line 1
|
||||||
line 2
|
line 2
|
||||||
line 3
|
line 3
|
||||||
@ -25,12 +25,12 @@ tasks:
|
|||||||
- echo 'dependend-task-2 was executed'
|
- echo 'dependend-task-2 was executed'
|
||||||
|
|
||||||
other-task-with-details:
|
other-task-with-details:
|
||||||
details: details of other-task-with-details
|
summary: details of other-task-with-details
|
||||||
cmds:
|
cmds:
|
||||||
- echo 'other-task-with-details was executed'
|
- echo 'other-task-with-details was executed'
|
||||||
|
|
||||||
task-with-description-containing-empty-line:
|
task-with-description-containing-empty-line:
|
||||||
details: |
|
summary: |
|
||||||
First line followed by empty line
|
First line followed by empty line
|
||||||
|
|
||||||
Last Line
|
Last Line
|
Loading…
x
Reference in New Issue
Block a user