aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--main_test.go1
-rw-r--r--modules/client.go4
-rw-r--r--testscripts/commands/mod_vendor.txt24
3 files changed, 28 insertions, 1 deletions
diff --git a/main_test.go b/main_test.go
index aae8a0a9e..6274cd9bb 100644
--- a/main_test.go
+++ b/main_test.go
@@ -50,6 +50,7 @@ func TestUnfinished(t *testing.T) {
p := commonTestScriptsParam
p.Dir = "testscripts/unfinished"
+ //p.UpdateScripts = true
testscript.Run(t, p)
}
diff --git a/modules/client.go b/modules/client.go
index 5d8daf926..53ce67cb3 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -292,8 +292,10 @@ func (c *Client) Vendor() error {
}
}
- // Also include any theme.toml or config.* files in the root.
+ // Also include any theme.toml or config.* or hugo.* files in the root.
configFiles, _ := afero.Glob(c.fs, filepath.Join(dir, "config.*"))
+ configFiles2, _ := afero.Glob(c.fs, filepath.Join(dir, "hugo.*"))
+ configFiles = append(configFiles, configFiles2...)
configFiles = append(configFiles, filepath.Join(dir, "theme.toml"))
for _, configFile := range configFiles {
if err := hugio.CopyFile(c.fs, configFile, filepath.Join(vendorDir, t.Path(), filepath.Base(configFile))); err != nil {
diff --git a/testscripts/commands/mod_vendor.txt b/testscripts/commands/mod_vendor.txt
new file mode 100644
index 000000000..8a77776b3
--- /dev/null
+++ b/testscripts/commands/mod_vendor.txt
@@ -0,0 +1,24 @@
+dostounix golden/vendor.txt
+
+hugo mod vendor
+cmp _vendor/modules.txt golden/vendor.txt
+ls _vendor/github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml
+stdout 'config.toml'
+ls _vendor/github.com/gohugoio/hugo-mod-integrationtests/withhugotoml
+stdout 'hugo.toml'
+
+
+-- hugo.toml --
+title = "Hugo Modules Test"
+[module]
+[[module.imports]]
+path="github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml"
+[[module.imports]]
+path="github.com/gohugoio/hugo-mod-integrationtests/withhugotoml"
+-- go.mod --
+go 1.19
+
+module github.com/gohugoio/testmod
+-- golden/vendor.txt --
+# github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml v1.0.0
+# github.com/gohugoio/hugo-mod-integrationtests/withhugotoml v1.0.0