mirror of
https://github.com/go-task/task.git
synced 2025-03-17 21:08:01 +02:00
Fix wrong error message beingg print when the file has a syntax error
Fixes #137
This commit is contained in:
parent
347fe87229
commit
08263c0597
@ -14,9 +14,12 @@ import (
|
||||
// Taskfile reads a Taskfile for a given directory
|
||||
func Taskfile(dir string) (*taskfile.Taskfile, error) {
|
||||
path := filepath.Join(dir, "Taskfile.yml")
|
||||
if _, err := os.Stat(path); err != nil {
|
||||
return nil, fmt.Errorf(`No Taskfile.yml found. Use "task --init" to create a new one`)
|
||||
}
|
||||
t, err := readTaskfile(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(`No Taskfile.yml found. Use "task --init" to create a new one`)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
path = filepath.Join(dir, fmt.Sprintf("Taskfile_%s.yml", runtime.GOOS))
|
||||
|
Loading…
x
Reference in New Issue
Block a user