mirror of
https://github.com/go-task/task.git
synced 2025-03-21 21:27:07 +02:00
24 lines
368 B
Go
24 lines
368 B
Go
|
package status
|
||
|
|
||
|
import (
|
||
|
"path/filepath"
|
||
|
"sort"
|
||
|
|
||
|
"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)
|
||
|
}
|
||
|
f, err := zglob.Glob(g)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
files = append(files, f...)
|
||
|
}
|
||
|
sort.Strings(files)
|
||
|
return
|
||
|
}
|