Open orxobo opened 5 years ago
Will you be adding a glob for directory file listing with a pattern? Here is a function you could add, adjusted from filepath
func glob(dir, pattern string, matches []string) (m []string, e error) { m = matches fi, err := pkger.Stat(dir) if err != nil { return } if !fi.IsDir() { return } d, err := pkger.Open(dir) if err != nil { return } defer d.Close() names, _ := d.Readdir(-1) sort.Strings(names) for _, n := range names { matched, err := filepath.Match(pattern, n) if err != nil { return m, err } if matched { m = append(m, Join(dir, n)) } } return }
Will you be adding a glob for directory file listing with a pattern? Here is a function you could add, adjusted from filepath