web frontend for git (tangled's grandpa)
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

config: Ensure we always have an absolute path

Having this consistent across the code is handy when we're building
paths, counting separators and other path manipulation.

authored by

Daniele Sluijters and committed by
Anirudh Oppiliappan
8586d930 1e7b6381

+11
+11
config/config.go
··· 3 3 import ( 4 4 "fmt" 5 5 "os" 6 + "path/filepath" 6 7 7 8 "gopkg.in/yaml.v3" 8 9 ) ··· 38 39 c := Config{} 39 40 if err := yaml.Unmarshal(b, &c); err != nil { 40 41 return nil, fmt.Errorf("parsing config: %w", err) 42 + } 43 + 44 + if c.Repo.ScanPath, err = filepath.Abs(c.Repo.ScanPath); err != nil { 45 + return nil, err 46 + } 47 + if c.Dirs.Templates, err = filepath.Abs(c.Dirs.Templates); err != nil { 48 + return nil, err 49 + } 50 + if c.Dirs.Static, err = filepath.Abs(c.Dirs.Static); err != nil { 51 + return nil, err 41 52 } 42 53 43 54 return &c, nil