summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRazon Yang <razonyang@gmail.com>2024-02-22 23:00:03 +0800
committerGitHub <noreply@github.com>2024-02-22 16:00:03 +0100
commitf5fd7ec8ccc1e2e325aa9b5ba94bbb36167a41a3 (patch)
tree22f717c2c44e48a3333622b86d0f8483a07153cd
parent16406d9d77cb4861bba9df8ca39e7dadfe41eb45 (diff)
commands/mod: Ignore invalid module path
-rw-r--r--modules/client.go2
-rw-r--r--testscripts/commands/mod_get_u.txt4
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/client.go b/modules/client.go
index c3371e0d4..f358f3f75 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -325,7 +325,7 @@ func (c *Client) Get(args ...string) error {
return coll.err
}
for _, m := range mc.AllModules {
- if m.Owner() == nil {
+ if m.Owner() == nil || !isProbablyModule(m.Path()) {
continue
}
modules = append(modules, m.Path())
diff --git a/testscripts/commands/mod_get_u.txt b/testscripts/commands/mod_get_u.txt
index b070309e0..f3efc0c1b 100644
--- a/testscripts/commands/mod_get_u.txt
+++ b/testscripts/commands/mod_get_u.txt
@@ -4,6 +4,7 @@ stdout 'commonmod@v1.0.1.*commonmod2@v1.0.2'
-- hugo.toml --
title = "Hugo Modules Update Test"
+theme = ["my-theme"]
[module]
[[module.imports]]
path="github.com/gohugoio/hugo-mod-integrationtests/withconfigtoml"
@@ -17,4 +18,5 @@ require (
github.com/gohugoio/hugo-mod-integrationtests/withhugotoml v1.1.0 // indirect
github.com/gohugoio/hugo-mod-integrationtests/commonmod v0.0.0-20230823103305-919cefe8a425 // indirect
)
-
+-- themes/my-theme/dummy.txt --
+MY THEME