modules: Add config option modules.vendorClosest

Fixes #8235
Fixes #8242
This commit is contained in:
Bjørn Erik Pedersen
2021-02-14 19:24:13 +01:00
parent b60e9279ab
commit bdfbcf6f4b
5 changed files with 64 additions and 9 deletions

View File

@@ -531,7 +531,16 @@ func (c *collector) collectModulesTXT(owner Module) error {
return errors.Errorf("invalid modules list: %q", filename)
}
path := parts[0]
if _, found := c.vendored[path]; !found {
shouldAdd := c.Client.moduleConfig.VendorClosest
if !shouldAdd {
if _, found := c.vendored[path]; !found {
shouldAdd = true
}
}
if shouldAdd {
c.vendored[path] = vendoredModule{
Owner: owner,
Dir: filepath.Join(vendorDir, path),