From 17db1a29b12487c8ae596a9be108fd3563e5e47d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 25 Jun 2024 20:23:50 +0200 Subject: simplify build command --- cmd/build/main.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/cmd/build/main.go b/cmd/build/main.go index d6b44d4..ee61a68 100644 --- a/cmd/build/main.go +++ b/cmd/build/main.go @@ -2,13 +2,11 @@ package main import ( "fmt" - "io/fs" "os" "website/internal/builder" "website/internal/log" - "github.com/BurntSushi/toml" "github.com/ardanlabs/conf/v3" "github.com/pkg/errors" ) @@ -31,20 +29,9 @@ func main() { log.Panic("could not change to source directory") } } - r, err := builder.BuildSite(ioConfig) + _, err := builder.BuildSite(ioConfig) if err != nil { - switch cause := errors.Cause(err).(type) { - case *fs.PathError: - log.Error("path error", "error", err) - case toml.ParseError: - log.Info("parse error", "error", err) - default: - log.Info("other error", "error", err, "cause", errors.Cause(cause)) - } + log.Error("could not build site", "error", err) os.Exit(1) } - - for _, h := range r.Hashes { - fmt.Printf("'%s'\n", h) - } } -- cgit 1.4.1