all repos — website @ 17db1a29b12487c8ae596a9be108fd3563e5e47d

My website

simplify build command
Alan Pearce alan@alanpearce.eu
Tue, 25 Jun 2024 20:23:50 +0200
commit

17db1a29b12487c8ae596a9be108fd3563e5e47d

parent

2841eea86e8ac39d63502ac253eab09c1425c13e

1 files changed, 2 insertions(+), 15 deletions(-)

jump to
M cmd/build/main.gocmd/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)
 	}
 }