]> git.maquefel.me Git - brevno-suite/hugo/commit
commands: Fix --panicOnWarning flag having no effect with module version warnings
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 15 Feb 2026 23:09:17 +0000 (00:09 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 16 Feb 2026 21:34:29 +0000 (22:34 +0100)
commit3f9d0ad2b6045849cbafe133cb9fb82ed5f5ee06
treed60ffc11ac0dbda15a3f195d9c8bd6ccf75a75d7
parentab62320d6bceece0faa7029f8bd79d546d0f64be
commands: Fix --panicOnWarning flag having no effect with module version warnings

The --panicOnWarning flag was not wired into the root command's logger,
so warnings emitted during config loading (such as module version
incompatibility warnings) would not trigger a panic.

Bind the panicOnWarning flag to the rootCommand struct and set the
PanicOnWarningHook on the logger created in createLogger.

Fixes #14524

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AGENTS.md
commands/commandeer.go
hugolib/integrationtest_builder.go
testscripts/commands/hugo__paniconwarning_mod.txt [new file with mode: 0644]