diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-06 09:39:05 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-06 09:39:05 +0800 |
commit | e82b94c33c1b2a4b26e7a76d0ea82a3364cd40f4 (patch) | |
tree | cb20273382eb6f78058d6cfe45158ecbe69b42f3 | |
parent | Restructure static/templates into forged (diff) | |
download | forge-e82b94c33c1b2a4b26e7a76d0ea82a3364cd40f4.tar.gz forge-e82b94c33c1b2a4b26e7a76d0ea82a3364cd40f4.tar.zst forge-e82b94c33c1b2a4b26e7a76d0ea82a3364cd40f4.zip |
Fix load ordering issue that causes the forge title to disappearv0.1.33
-rw-r--r-- | forged/internal/unsorted/server.go | 8 |
1 files 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"))) |