mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
commands: Fix data race in test
Note that this is a test fix only.
This commit is contained in:
@@ -302,6 +302,7 @@ func (c *commandeer) loadConfig() error {
|
||||
cfg := c.DepsCfg
|
||||
c.configured = false
|
||||
cfg.Running = c.running
|
||||
loggers.PanicOnWarning.Store(c.h.panicOnWarning)
|
||||
|
||||
var dir string
|
||||
if c.h.source != "" {
|
||||
|
@@ -208,9 +208,10 @@ type hugoBuilderCommon struct {
|
||||
baseURL string
|
||||
environment string
|
||||
|
||||
buildWatch bool
|
||||
poll string
|
||||
clock string
|
||||
buildWatch bool
|
||||
panicOnWarning bool
|
||||
poll string
|
||||
clock string
|
||||
|
||||
gc bool
|
||||
|
||||
@@ -299,7 +300,7 @@ func (cc *hugoBuilderCommon) handleFlags(cmd *cobra.Command) {
|
||||
cmd.Flags().Bool("enableGitInfo", false, "add Git revision, date, author, and CODEOWNERS info to the pages")
|
||||
cmd.Flags().BoolVar(&cc.gc, "gc", false, "enable to run some cleanup tasks (remove unused cache files) after the build")
|
||||
cmd.Flags().StringVar(&cc.poll, "poll", "", "set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes")
|
||||
cmd.Flags().BoolVar(&loggers.PanicOnWarning, "panicOnWarning", false, "panic on first WARNING log")
|
||||
cmd.Flags().BoolVar(&cc.panicOnWarning, "panicOnWarning", false, "panic on first WARNING log")
|
||||
cmd.Flags().Bool("templateMetrics", false, "display metrics about template executions")
|
||||
cmd.Flags().Bool("templateMetricsHints", false, "calculate some improvement hints when combined with --templateMetrics")
|
||||
cmd.Flags().BoolP("forceSyncStatic", "", false, "copy all files when static is changed.")
|
||||
|
@@ -255,6 +255,7 @@ func initializeFlags(cmd *cobra.Command, cfg config.Provider) {
|
||||
setValueFromFlag(cmd.Flags(), "destination", cfg, "publishDir", false)
|
||||
setValueFromFlag(cmd.Flags(), "printI18nWarnings", cfg, "logI18nWarnings", false)
|
||||
setValueFromFlag(cmd.Flags(), "printPathWarnings", cfg, "logPathWarnings", false)
|
||||
|
||||
}
|
||||
|
||||
func setValueFromFlag(flags *flag.FlagSet, key string, cfg config.Provider, targetKey string, force bool) {
|
||||
|
Reference in New Issue
Block a user