commands/mod: Ignore invalid module path

This commit is contained in:
Razon Yang 2024-02-22 23:00:03 +08:00 committed by GitHub
parent 16406d9d77
commit f5fd7ec8cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -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())

View file

@ -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