diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-11-23 16:29:32 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-11-23 16:29:32 +0100 |
commit | 0ab81896d90e0111dc9c9611e9f0eceddd3732b6 (patch) | |
tree | d0b12db684593d8774e60e1524b60c490ea572f5 | |
parent | e00fdae4562c3329b9d877425c43aa8484784e5c (diff) | |
download | hugo-0ab81896d90e0111dc9c9611e9f0eceddd3732b6.tar.gz hugo-0ab81896d90e0111dc9c9611e9f0eceddd3732b6.zip |
modules: Skip empty lines in modules.txt
Closes #13084
-rw-r--r-- | modules/collect.go | 3 |
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) |