1
0
mirror of https://github.com/go-task/task.git synced 2024-12-04 10:24:45 +02:00

"file does not exist" improving for watchers

Adds additional (initial missing) context to the go generic
`os.ErrNotExist` error, in addition to other errors that (possibly)
can be returned by `zglob.Glob`

Closes #472
This commit is contained in:
Oleg Butuzov 2021-04-18 13:52:55 +03:00 committed by Andrey Nering
parent 05ddfc0495
commit 9b42ef5d46

View File

@ -2,6 +2,7 @@ package task
import (
"context"
"fmt"
"os"
"os/signal"
"path/filepath"
@ -129,7 +130,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...taskfile.Ca
for _, s := range task.Sources {
files, err := zglob.Glob(s)
if err != nil {
return err
return fmt.Errorf("task: %s: %w", s, err)
}
for _, f := range files {
absFile, err := filepath.Abs(f)