Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-02-14 21:24:13 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-02-16 18:30:01 +0300
commitbdfbcf6f4b4ab53a617ab76f72e8aa28da6067de (patch)
treea5b2fb8aeabe9103bb44b2516533f2c498806d08 /modules/collect.go
parentb60e9279ab95030828eb4f822be96250284c4d8d (diff)
modules: Add config option modules.vendorClosest
Fixes #8235 Fixes #8242
Diffstat (limited to 'modules/collect.go')
-rw-r--r--modules/collect.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/collect.go b/modules/collect.go
index 4de51258b..db79f434e 100644
--- a/modules/collect.go
+++ b/modules/collect.go
@@ -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),