mirror of
https://github.com/go-task/task.git
synced 2024-12-14 10:52:43 +02:00
57a01aa6ff
There was some breaking changes described at https://github.com/mvdan/sh/issues/335#issuecomment-447605295
30 lines
479 B
Go
30 lines
479 B
Go
package status
|
|
|
|
import (
|
|
"path/filepath"
|
|
"sort"
|
|
|
|
"github.com/go-task/task/v2/internal/execext"
|
|
|
|
"github.com/mattn/go-zglob"
|
|
)
|
|
|
|
func glob(dir string, globs []string) (files []string, err error) {
|
|
for _, g := range globs {
|
|
if !filepath.IsAbs(g) {
|
|
g = filepath.Join(dir, g)
|
|
}
|
|
g, err = execext.Expand(g)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
f, err := zglob.Glob(g)
|
|
if err != nil {
|
|
continue
|
|
}
|
|
files = append(files, f...)
|
|
}
|
|
sort.Strings(files)
|
|
return
|
|
}
|