1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

Merge branch 'list-task-names' of https://github.com/ardnew/task into ardnew-list-task-names

This commit is contained in:
Andrey Nering
2022-03-31 21:31:56 -03:00
3 changed files with 49 additions and 2 deletions

15
task.go
View File

@@ -104,8 +104,13 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
return g.Wait()
}
// Setup setups Executor's internal state
func (e *Executor) Setup() error {
// readTaskfile selects and parses the entrypoint.
func (e *Executor) readTaskfile() error {
// select the default entrypoint if not provided
if e.Entrypoint == "" {
e.Entrypoint = "Taskfile.yml"
}
var err error
e.Taskfile, err = read.Taskfile(&read.ReaderNode{
Dir: e.Dir,
@@ -113,6 +118,12 @@ func (e *Executor) Setup() error {
Parent: nil,
Optional: false,
})
return err
}
// Setup setups Executor's internal state
func (e *Executor) Setup() error {
err := e.readTaskfile()
if err != nil {
return err
}