quickly print task names only with flags --silent and --list

This commit is contained in:
ardnew
2021-07-01 16:05:46 -05:00
parent a018997ddc
commit 978a6e5ecb
3 changed files with 50 additions and 2 deletions

15
task.go
View File

@@ -104,10 +104,21 @@ 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(e.Dir, e.Entrypoint)
return err
}
// Setup setups Executor's internal state
func (e *Executor) Setup() error {
err := e.readTaskfile()
if err != nil {
return err
}