From e82b94c33c1b2a4b26e7a76d0ea82a3364cd40f4 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 6 Apr 2025 09:39:05 +0800 Subject: Fix load ordering issue that causes the forge title to disappear --- forged/internal/unsorted/server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/forged/internal/unsorted/server.go b/forged/internal/unsorted/server.go index c7caa76..7d1319d 100644 --- a/forged/internal/unsorted/server.go +++ b/forged/internal/unsorted/server.go @@ -55,10 +55,6 @@ func NewServer(configPath string) (*Server, error) { globalData: make(map[string]any), } //exhaustruct:ignore - if err := s.loadConfig(configPath); err != nil { - return s, err - } - s.sourceHandler = http.StripPrefix( "/-/source/", http.FileServer(http.FS(embed.Source)), @@ -75,6 +71,10 @@ func NewServer(configPath string) (*Server, error) { // Some other ones are populated after config parsing } + if err := s.loadConfig(configPath); err != nil { + return s, err + } + misc.NoneOrPanic(s.loadTemplates()) misc.NoneOrPanic(misc.DeployBinary(misc.FirstOrPanic(embed.Resources.Open("git2d/git2d")), s.config.Git.DaemonPath)) misc.NoneOrPanic(misc.DeployBinary(misc.FirstOrPanic(embed.Resources.Open("hookc/hookc")), filepath.Join(s.config.Hooks.Execs, "pre-receive"))) -- cgit v1.2.3