From f5fd7ec8ccc1e2e325aa9b5ba94bbb36167a41a3 Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Thu, 22 Feb 2024 23:00:03 +0800 Subject: [PATCH] commands/mod: Ignore invalid module path --- modules/client.go | 2 +- testscripts/commands/mod_get_u.txt | 4 +++- 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