mirror of https://github.com/databricks/cli.git
23 lines
356 B
Go
23 lines
356 B
Go
package fileset
|
|
|
|
import (
|
|
"path/filepath"
|
|
)
|
|
|
|
func NewGlobSet(root string, includes []string) (*FileSet, error) {
|
|
absRoot, err := filepath.Abs(root)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
for k := range includes {
|
|
includes[k] = filepath.ToSlash(filepath.Clean(includes[k]))
|
|
}
|
|
|
|
fs := &FileSet{
|
|
absRoot,
|
|
newIncluder(includes),
|
|
}
|
|
return fs, nil
|
|
}
|