Skip to content

Commit f3a3674

Browse files
committed
change current working directory before initializing any extension
1 parent e104f12 commit f3a3674

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

handlers.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ func Start(ctx context.Context) {
3636
Listen(PageDeleted, clearPagesCache)
3737
}
3838

39-
initExtensions()
40-
41-
Get("/{$}", rootHandler)
42-
Get("/{page...}", getPageHandler)
43-
4439
if err := os.Chdir(Config.Source); err != nil {
4540
slog.Error("Failed to change dir to source", "error", err, "source", Config.Source)
4641
os.Exit(1)
4742
}
4843

44+
initExtensions()
45+
46+
Get("/{$}", rootHandler)
47+
Get("/{page...}", getPageHandler)
48+
4949
if len(Config.Build) > 0 {
5050
if err := build(Config.Build); err != nil {
5151
slog.Error("Failed to build static pages", "error", err)

0 commit comments

Comments
 (0)