Skip to content

Commit

Permalink
commands/mod: Ignore invalid module path
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Feb 22, 2024
1 parent 16406d9 commit f5fd7ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/client.go
Expand Up @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion testscripts/commands/mod_get_u.txt
Expand Up @@ -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"
Expand All @@ -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

0 comments on commit f5fd7ec

Please sign in to comment.