diff --git a/CHANGELOG.md b/CHANGELOG.md index fec08b25..0827d1ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- The `--list` and `--list-all` flags can now be combined with the `--silent` + flag to print the task names only, without their description + ([#691](https://github.com/go-task/task/pull/691)). - Added support for multi-level inclusion of Taskfiles. This means that included Taskfiles can also include other Taskfiles. Before this was limited to one level diff --git a/help.go b/help.go index 315daaae..9b9a5874 100644 --- a/help.go +++ b/help.go @@ -3,6 +3,7 @@ package task import ( "fmt" "io" + "log" "os" "sort" "strings" @@ -79,8 +80,11 @@ func (e *Executor) tasksWithDesc() (tasks []*taskfile.Task) { // Otherwise, all task names are printed. func (e *Executor) ListTaskNames(allTasks bool) { // if called from cmd/task.go, e.Taskfile has not yet been parsed - if nil == e.Taskfile && e.readTaskfile() != nil { - return + if e.Taskfile == nil { + if err := e.readTaskfile(); err != nil { + log.Fatal(err) + return + } } // use stdout if no output defined var w io.Writer = os.Stdout diff --git a/task.go b/task.go index 6b9cc39e..ec224260 100644 --- a/task.go +++ b/task.go @@ -106,11 +106,6 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) 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,