about summary refs log tree commit diff stats
path: root/cmd/build
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/build')
-rw-r--r--cmd/build/build.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/build/build.go b/cmd/build/build.go
index 4254bf8..5007ead 100644
--- a/cmd/build/build.go
+++ b/cmd/build/build.go
@@ -26,6 +26,7 @@ import (
 	"github.com/antchfx/xmlquery"
 	"github.com/antchfx/xpath"
 	mapset "github.com/deckarep/golang-set/v2"
+	cp "github.com/otiai10/copy"
 	"github.com/pkg/errors"
 	"github.com/yuin/goldmark"
 	"github.com/yuin/goldmark/extension"
@@ -529,6 +530,15 @@ func main() {
 		log.Panic(errors.Errorf("working directory does not exist: %v", err))
 	}
 
+	err = os.RemoveAll("public")
+	if err != nil {
+		log.Panic(errors.Errorf("could not remove public directory: %v", err))
+	}
+	err = cp.Copy("static", "public", cp.Options{})
+	if err != nil {
+		log.Panic(errors.Errorf("could not copy static files: %v", err))
+	}
+
 	if err := build(); err != nil {
 		switch cause := errors.Cause(err).(type) {
 		case *fs.PathError: