all repos — website @ 767caaab43143fd5e22bbea044f1aa83ebb13517

My website

fix empty initial build in dev
Alan Pearce alan@alanpearce.eu
Wed, 26 Jun 2024 18:45:56 +0200
commit

767caaab43143fd5e22bbea044f1aa83ebb13517

parent

aa6d63c3539f9243d1b325f3585faddcf7d01070

2 files changed, 7 insertions(+), 7 deletions(-)

jump to
M cmd/server/main.gocmd/server/main.go
@@ -25,6 +25,13 @@ panic("parsing runtime configuration" + err.Error()) 	}
 	log.Configure(!runtimeConfig.Development)
 
+	tmpdir, err := os.MkdirTemp("", "website")
+	if err != nil {
+		log.Fatal("could not create temporary directory", "error", err)
+	}
+	defer os.RemoveAll(tmpdir)
+	runtimeConfig.Root = tmpdir
+
 	sv, err := server.New(&runtimeConfig)
 	if err != nil {
 		log.Error("could not create server", "error", err)
M internal/server/server.gointernal/server/server.go
@@ -103,13 +103,6 @@ if err != nil { 			return nil, err
 		}
 		runtimeConfig.Root = "website"
-	} else {
-		tmpdir, err := os.MkdirTemp("", "website")
-		if err != nil {
-			return nil, err
-		}
-		defer os.RemoveAll(tmpdir)
-		runtimeConfig.Root = tmpdir
 	}
 
 	config, err := cfg.GetConfig()