Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Glob ¶
Glob is the main glob function that is used to get a list of files in a specific directory matching the patterns and respecting the ignores
func Match ¶
func Match(p *ParsedPattern, path string) bool
Types ¶
type GlobPatterns ¶
type GlobPatterns = map[string]*ParsedPattern
func ParseGitignore ¶
func ParseGitignore(file string) (GlobPatterns, error)
func ParseGitignoreContent ¶
func ParseGitignoreContent(content string) (GlobPatterns, error)
ParseGitignoreContent parses a file according to: http://git-scm.com/docs/gitignore
type Options ¶
type Options struct { IgnorePatterns []string IgnoreFiles []string CWD string Patterns []string AbsolutePaths bool Debug bool }
func CWD ¶
CWD sets a cwd where the glob pattern is executed in by default the process current working directory is used
func IgnoreFile ¶
IgnoreFiles provides a list on file paths relative to the current working directory that follow the .gitignore syntax and are used to provide ignore patterns
func IgnorePattern ¶
IgnorePatterns sets a list of patterns that is used for ignoring specific files or directories
type ParsedPattern ¶
type ParsedPattern struct { // input is the original glob pattern Input string RegExp *regexp.Regexp IsGlobstar bool // base is the base folder that can be used for matching a glob. // For example if a glob starts with `src/**/*.ts` we don't need to crawl all // folders in the current working directory as we see the `src` as base folder Base string // contains filtered or unexported fields }
func Parse ¶
func Parse(input string) (*ParsedPattern, error)
func (*ParsedPattern) Compile ¶
func (p *ParsedPattern) Compile() (*ParsedPattern, error)
func (*ParsedPattern) String ¶
func (p *ParsedPattern) String() string
Click to show internal directories.
Click to hide internal directories.