simplify build command
Alan Pearce alan@alanpearce.eu
Tue, 25 Jun 2024 20:23:50 +0200
1 files changed, 2 insertions(+), 15 deletions(-)
jump to
M cmd/build/main.go → 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 @@ if err != nil { 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) } }