Skip to content

Commit

Permalink
modules: Throw an error running hugo mod vendor on mountless module
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Feb 15, 2021
1 parent bf55afd commit 4ffaeaf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4ffaeaf

Please sign in to comment.