Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic when specifying multiple excludeFiles directives #9076

Closed
stapelberg opened this issue Oct 23, 2021 · 2 comments
Closed

panic when specifying multiple excludeFiles directives #9076

stapelberg opened this issue Oct 23, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@stapelberg
Copy link

Thank you @bep for adding excludeFiles in 471ed91

The directive seems to work fine when using a single excludeFiles string value:

[module]
[[module.mounts]]
  source = 'static'
  target = 'static'
  excludeFiles = "turbopfor/*[^s][^v][^g][^o].svg"

But when I want to add another exclude pattern, hugo panics:

[module]
[[module.mounts]]
  source = 'static'
  target = 'static'
  excludeFiles = ["turbopfor/*[^s][^v][^g][^o].svg", "turbopfor/Makefile"]
$ hugo
Total in 0 ms
panic: runtime error: hash of unhashable type []interface {}

goroutine 1 [running]:
type..hash.github.com/gohugoio/hugo/modules.Mount(0xc0004deaf0, 0x0)
	<autogenerated>:1 +0x6e
github.com/gohugoio/hugo/modules.filterUnwantedMounts({0xc00012f200, 0x7, 0x7})
	/home/michael/go/src/github.com/gohugoio/hugo/modules/collect.go:155 +0x192
github.com/gohugoio/hugo/modules.(*ModulesConfig).finalize(0xc0000ae9c0, {0x252d5b0, 0xc00058dc50})
	/home/michael/go/src/github.com/gohugoio/hugo/modules/collect.go:145 +0x85
github.com/gohugoio/hugo/modules.(*Client).Collect(0xc00069d400)
	/home/michael/go/src/github.com/gohugoio/hugo/modules/collect.go:84 +0x1e7
github.com/gohugoio/hugo/hugolib.configLoader.collectModules({{0x2528ab8, 0xc00078ee10}, {{0x2527420, 0x34b2f00}, {0x252d5b0, 0xc00058dc50}, {0x0, 0x0}, {0xc00004c01c, 0x12}, ...}}, ...)
	/home/michael/go/src/github.com/gohugoio/hugo/hugolib/config.go:419 +0x445
github.com/gohugoio/hugo/hugolib.LoadConfig({{0x2527420, 0x34b2f00}, {0x252d5b0, 0xc00058dc50}, {0x0, 0x0}, {0xc00004c01c, 0x12}, {0xc00004c01c, 0x12}, ...}, ...)
	/home/michael/go/src/github.com/gohugoio/hugo/hugolib/config.go:154 +0xc3e
github.com/gohugoio/hugo/commands.(*commandeer).loadConfig(0xc000612c40)
	/home/michael/go/src/github.com/gohugoio/hugo/commands/commandeer.go:309 +0x365
github.com/gohugoio/hugo/commands.newCommandeer(0x1, 0x1, 0x0, 0xc000612a80, {0x24d9980, 0xc0004178e0}, 0xc000417a80, {0x0, 0x0, 0x0})
	/home/michael/go/src/github.com/gohugoio/hugo/commands/commandeer.go:193 +0x310
github.com/gohugoio/hugo/commands.initializeConfig(0x7, 0x0, 0x0, 0xc0004dfd18, {0x24d9980, 0xc0004178e0}, 0xc0006a0460)
	/home/michael/go/src/github.com/gohugoio/hugo/commands/hugo.go:125 +0x31
github.com/gohugoio/hugo/commands.(*commandsBuilder).newHugoCmd.func1(0xc00069c000, {0x2057bf4, 0x0, 0x0})
	/home/michael/go/src/github.com/gohugoio/hugo/commands/commands.go:168 +0x155
github.com/spf13/cobra.(*Command).execute(0xc00069c000, {0xc00003c1e0, 0x0, 0x0})
	/home/michael/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc00069c000)
	/home/michael/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
github.com/gohugoio/hugo/commands.Execute({0xc00003c1e0, 0x0, 0x0})
	/home/michael/go/src/github.com/gohugoio/hugo/commands/hugo.go:92 +0xb4
main.main()
	/home/michael/go/src/github.com/gohugoio/hugo/main.go:23 +0x58

What version of Hugo are you using (hugo version)?

git commit 70e4548

$ hugo version
hugo v0.89.0-DEV+extended linux/amd64 BuildDate=unknown
@bep bep self-assigned this Oct 25, 2021
@bep bep added this to the v0.89 milestone Oct 25, 2021
@bep
Copy link
Member

bep commented Oct 25, 2021

Thanks for that report, I willl fix -- I kind of just assumed that it would work.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants