Fix hugo benchmark --renderToMemory
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 6 Jan 2018 09:37:04 +0000 (10:37 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 6 Jan 2018 09:37:04 +0000 (10:37 +0100)
Fixes #4218

commands/benchmark.go

index 77790e24a60455c931c4dea5337fc84335b47794..a66aee0b5425fa3041cd911df7a6e91efbd915f9 100644 (file)
@@ -48,7 +48,11 @@ func init() {
 }
 
 func benchmark(cmd *cobra.Command, args []string) error {
-       c, err := InitializeConfig(false, nil, benchmarkCmd)
+       cfgInit := func(c *commandeer) error {
+               c.Set("renderToMemory", renderToMemory)
+               return nil
+       }
+       c, err := InitializeConfig(false, cfgInit, benchmarkCmd)
        if err != nil {
                return err
        }