mirror of
https://github.com/go-task/task.git
synced 2026-07-08 14:35:18 +00:00
feat: support negative globs (#1324)
Co-authored-by: Andrey Nering <andrey@nering.com.br>
This commit is contained in:
@@ -80,6 +80,21 @@ func (r *Templater) ReplaceSlice(strs []string) []string {
|
||||
return new
|
||||
}
|
||||
|
||||
func (r *Templater) ReplaceGlobs(globs []*taskfile.Glob) []*taskfile.Glob {
|
||||
if r.err != nil || len(globs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
new := make([]*taskfile.Glob, len(globs))
|
||||
for i, g := range globs {
|
||||
new[i] = &taskfile.Glob{
|
||||
Glob: r.Replace(g.Glob),
|
||||
Negate: g.Negate,
|
||||
}
|
||||
}
|
||||
return new
|
||||
}
|
||||
|
||||
func (r *Templater) ReplaceVars(vars *taskfile.Vars) *taskfile.Vars {
|
||||
return r.replaceVars(vars, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user