diff options
author | Alan Pearce | 2024-06-29 21:27:35 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-29 21:27:35 +0200 |
commit | 973fa31b6743a3ea84c86ab7671349cc70a69142 (patch) | |
tree | 4c583c8ef5e7a9117fe997a4f861ae7466fa0864 /cmd/build | |
parent | 7b82d3ef3e93c0c8efe489d6b11b30f092667bf2 (diff) | |
download | website-973fa31b6743a3ea84c86ab7671349cc70a69142.tar.lz website-973fa31b6743a3ea84c86ab7671349cc70a69142.tar.zst website-973fa31b6743a3ea84c86ab7671349cc70a69142.zip |
enable filtered debug logging via DEBUG="component.*"
Diffstat (limited to 'cmd/build')
-rw-r--r-- | cmd/build/main.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/build/main.go b/cmd/build/main.go index 14175e9..39cbc1b 100644 --- a/cmd/build/main.go +++ b/cmd/build/main.go @@ -5,6 +5,7 @@ import ( "os" "go.alanpearce.eu/website/internal/builder" + "go.alanpearce.eu/website/internal/config" "go.alanpearce.eu/website/internal/log" "github.com/ardanlabs/conf/v3" @@ -20,7 +21,7 @@ func main() { } panic("error parsing configuration: " + err.Error()) } - log.Configure(!ioConfig.Development) + log := log.Configure(!ioConfig.Development) log.Debug("starting build process") if ioConfig.Source != "." { @@ -29,7 +30,12 @@ func main() { log.Panic("could not change to source directory") } } - _, err := builder.BuildSite(ioConfig, nil) + cfg, err := config.GetConfig(ioConfig.Source, log) + if err != nil { + log.Error("could not read config", "error", err) + } + + _, err = builder.BuildSite(ioConfig, cfg, log) if err != nil { log.Error("could not build site", "error", err) os.Exit(1) |