diff options
author | Bjørn Erik Pedersen <[email protected]> | 2020-09-09 16:51:13 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-09-10 08:47:05 +0200 |
commit | 9a1e6d15a31ec667b2ff9cf20e43b1daca61e004 (patch) | |
tree | 1e5bfed58030989858820e3e2e1ceba0b46a31c2 /hugolib/config.go | |
parent | 84adecf97baa91ab18cb26812fa864b4451d3c5f (diff) | |
download | hugo-9a1e6d15a31ec667b2ff9cf20e43b1daca61e004.tar.gz hugo-9a1e6d15a31ec667b2ff9cf20e43b1daca61e004.zip |
modules: Make ignoreVendor a glob pattern
Fixes #7642
Diffstat (limited to 'hugolib/config.go')
-rw-r--r-- | hugolib/config.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/hugolib/config.go b/hugolib/config.go index 841bd5193..cab2013ca 100644 --- a/hugolib/config.go +++ b/hugolib/config.go @@ -18,6 +18,9 @@ import ( "path/filepath" "strings" + "github.com/gobwas/glob" + hglob "github.com/gohugoio/hugo/hugofs/glob" + "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/cache/filecache" @@ -202,6 +205,12 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid } } + // We made this a Glob pattern in Hugo 0.75, we don't need both. + if v.GetBool("ignoreVendor") { + helpers.Deprecated("--ignoreVendor", "--ignoreVendorPaths **", false) + v.Set("ignoreVendorPaths", "**") + } + modulesConfig, err := l.loadModulesConfig(v) if err != nil { return v, configFiles, err @@ -417,7 +426,10 @@ func (l configLoader) collectModules(modConfig modules.Config, v1 *viper.Viper, themesDir := paths.AbsPathify(l.WorkingDir, v1.GetString("themesDir")) - ignoreVendor := v1.GetBool("ignoreVendor") + var ignoreVendor glob.Glob + if s := v1.GetString("ignoreVendorPaths"); s != "" { + ignoreVendor, _ = hglob.GetGlob(hglob.NormalizePath(s)) + } filecacheConfigs, err := filecache.DecodeConfig(l.Fs, v1) if err != nil { |