Skip to content

Commit

Permalink
modules/client: Vendor config directory if present
Browse files Browse the repository at this point in the history
Fixes #9751
  • Loading branch information
jmooring authored and bep committed Apr 5, 2022
1 parent e58a540 commit a8c221d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/client.go
Expand Up @@ -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"))
Expand Down

0 comments on commit a8c221d

Please sign in to comment.