modules: Do not try to get local themes in "hugo mod get"

Fixes #6893
This commit is contained in:
Bjørn Erik Pedersen 2020-02-18 13:35:29 +01:00
parent a21a9373e0
commit 20f2211fce
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -264,6 +264,13 @@ func (c *Client) Get(args ...string) error {
// We need to be explicit about the modules to get. // We need to be explicit about the modules to get.
for _, m := range c.moduleConfig.Imports { for _, m := range c.moduleConfig.Imports {
if !isProbablyModule(m.Path) {
// Skip themes/components stored below /themes etc.
// There may be false positives in the above, but those
// should be rare, and they will fail below with an
// "cannot find module providing ..." message.
continue
}
var args []string var args []string
if update { if update {
args = []string{"-u"} args = []string{"-u"}