summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-02-15 10:47:32 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-02-15 10:47:32 +0100
commit4ffaeaf15536596c94dc73b393ca7894e3bd5e2c (patch)
tree95db1743498d040291f80f088771ec9012a3c246 /modules
parentbf55afd71f2fdb47272ebf1188c9cc87df47b233 (diff)
modules: Throw an error running hugo mod vendor on mountless module
Diffstat (limited to 'modules')
-rw-r--r--modules/client.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/client.go b/modules/client.go
index 1640e1907..571ece15e 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -237,6 +237,12 @@ func (c *Client) Vendor() error {
continue
}
+ // See https://github.com/gohugoio/hugo/issues/8239
+ // This is an error situation. We need something to vendor.
+ if t.Mounts() == nil {
+ return errors.Errorf("cannot vendor module %q, need at least one mount", t.Path())
+ }
+
fmt.Fprintln(&modulesContent, "# "+t.Path()+" "+t.Version())
dir := t.Dir()