aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoe Mooring <[email protected]>2022-04-05 10:36:08 -0700
committerBjørn Erik Pedersen <[email protected]>2022-04-05 20:39:04 +0200
commita8c221d33b81aa73ce0dbd99ab862e3a685c60f3 (patch)
tree91cdbeb79fb0ecfa8aedda0d124abf9d20de0a66
parente58a540895c28b8884823dcb1b64c272422f9923 (diff)
downloadhugo-a8c221d33b81aa73ce0dbd99ab862e3a685c60f3.tar.gz
hugo-a8c221d33b81aa73ce0dbd99ab862e3a685c60f3.zip
modules/client: Vendor config directory if present
Fixes #9751
-rw-r--r--modules/client.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/client.go b/modules/client.go
index eab871d01..6e1cfe881 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -282,6 +282,15 @@ func (c *Client) Vendor() error {
}
}
+ // Include the config directory if present.
+ configDir := filepath.Join(dir, "config")
+ _, err = c.fs.Stat(configDir)
+ if err == nil {
+ if err := hugio.CopyDir(c.fs, configDir, filepath.Join(vendorDir, t.Path(), "config"), nil); err != nil {
+ return errors.Wrap(err, "failed to copy config dir to vendor dir")
+ }
+ }
+
// Also include any theme.toml or config.* files in the root.
configFiles, _ := afero.Glob(c.fs, filepath.Join(dir, "config.*"))
configFiles = append(configFiles, filepath.Join(dir, "theme.toml"))