mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
modules: Add config option modules.vendorClosest
Fixes #8235 Fixes #8242
This commit is contained in:
@@ -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),
|
||||
|
Reference in New Issue
Block a user