summaryrefslogtreecommitdiffstats
path: root/modules/client.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-09-09 16:51:13 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-09-10 08:47:05 +0200
commit9a1e6d15a31ec667b2ff9cf20e43b1daca61e004 (patch)
tree1e5bfed58030989858820e3e2e1ceba0b46a31c2 /modules/client.go
parent84adecf97baa91ab18cb26812fa864b4451d3c5f (diff)
modules: Make ignoreVendor a glob pattern
Fixes #7642
Diffstat (limited to 'modules/client.go')
-rw-r--r--modules/client.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/client.go b/modules/client.go
index c66311d05..914d06a4e 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -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 {