modules: Make ignoreVendor a glob pattern

Fixes #7642
This commit is contained in:
Bjørn Erik Pedersen 2020-09-09 16:51:13 +02:00
parent 84adecf97b
commit 9a1e6d15a3
9 changed files with 124 additions and 83 deletions

View file

@ -605,8 +605,9 @@ type ClientConfig struct {
// etc.
HookBeforeFinalize func(m *ModulesConfig) error
// Ignore any _vendor directory.
IgnoreVendor bool
// Ignore any _vendor directory for module paths matching the given pattern.
// This can be nil.
IgnoreVendor glob.Glob
// Absolute path to the project dir.
WorkingDir string
@ -618,6 +619,10 @@ type ClientConfig struct {
ModuleConfig Config
}
func (c ClientConfig) shouldIgnoreVendor(path string) bool {
return c.IgnoreVendor != nil && c.IgnoreVendor.Match(path)
}
type goBinaryStatus int
type goModule struct {