aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-11-23 16:29:32 +0100
committerBjørn Erik Pedersen <[email protected]>2024-11-23 16:29:32 +0100
commit0ab81896d90e0111dc9c9611e9f0eceddd3732b6 (patch)
treed0b12db684593d8774e60e1524b60c490ea572f5
parente00fdae4562c3329b9d877425c43aa8484784e5c (diff)
downloadhugo-0ab81896d90e0111dc9c9611e9f0eceddd3732b6.tar.gz
hugo-0ab81896d90e0111dc9c9611e9f0eceddd3732b6.zip
modules: Skip empty lines in modules.txt
Closes #13084
-rw-r--r--modules/collect.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/collect.go b/modules/collect.go
index 4eb12a1a6..7034a6b16 100644
--- a/modules/collect.go
+++ b/modules/collect.go
@@ -556,6 +556,9 @@ func (c *collector) collectModulesTXT(owner Module) error {
line := scanner.Text()
line = strings.Trim(line, "# ")
line = strings.TrimSpace(line)
+ if line == "" {
+ continue
+ }
parts := strings.Fields(line)
if len(parts) != 2 {
return fmt.Errorf("invalid modules list: %q", filename)