aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-02-17 12:32:25 +0100
committerBjørn Erik Pedersen <[email protected]>2024-02-17 13:14:15 +0100
commit4835f9e898350ac49d68fba2343a71ceb29e6897 (patch)
treea475d6abd228cc1f76989a7ead71599e9f389c44
parent5bdda0bdbf5eca4064d395219d0797aaed24070f (diff)
downloadhugo-4835f9e898350ac49d68fba2343a71ceb29e6897.tar.gz
hugo-4835f9e898350ac49d68fba2343a71ceb29e6897.zip
commands: Fix --clock with the list command
Fixes #11888
-rw-r--r--commands/list.go3
-rw-r--r--testscripts/commands/list.txt3
2 files changed, 4 insertions, 2 deletions
diff --git a/commands/list.go b/commands/list.go
index 41a45e402..8debe5ca5 100644
--- a/commands/list.go
+++ b/commands/list.go
@@ -23,7 +23,6 @@ import (
"time"
"github.com/bep/simplecobra"
- "github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/hugolib"
"github.com/gohugoio/hugo/resources/page"
"github.com/gohugoio/hugo/resources/resource"
@@ -46,7 +45,7 @@ func newListCommand() *listCommand {
list := func(cd *simplecobra.Commandeer, r *rootCommand, shouldInclude func(page.Page) bool, opts ...any) error {
bcfg := hugolib.BuildCfg{SkipRender: true}
- cfg := config.New()
+ cfg := flagsToCfg(cd, nil)
for i := 0; i < len(opts); i += 2 {
cfg.Set(opts[i].(string), opts[i+1])
}
diff --git a/testscripts/commands/list.txt b/testscripts/commands/list.txt
index 42d74cec7..8cbf93266 100644
--- a/testscripts/commands/list.txt
+++ b/testscripts/commands/list.txt
@@ -28,6 +28,9 @@ stdout 'expired.md'
stdout 'draftexpired.md'
stdout 'draftfuture.md'
+hugo list expired --clock 2000-01-01T00:00:00Z
+! stdout 'expired.md'
+
-- hugo.toml --
baseURL = "https://example.org/"
disableKinds = ["taxonomy", "term"]