Skip to content

Commit

Permalink
fix: handle relative StylePaths
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Jan 7, 2024
1 parent 29a4450 commit a61c1d2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/core/ini.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,15 @@ var globalOpts = map[string]func(*ini.Section, *Config, []string){
var coreOpts = map[string]func(*ini.Section, *Config, []string) error{
"StylesPath": func(sec *ini.Section, cfg *Config, args []string) error {
paths := sec.Key("StylesPath").ValueWithShadows()
if cfg.Flags.Local && len(paths) == 2 {
basePath := determinePath(args[0], filepath.FromSlash(paths[1]))
if cfg.Flags.Local && len(args) == 2 {
// This case handles the situation where both configs define the
// same StylesPath (e.g., `StylesPath = styles`).
basePath := determinePath(args[0], filepath.FromSlash(paths[0]))
mockPath := determinePath(args[1], filepath.FromSlash(paths[0]))
if len(paths) == 2 {
basePath = determinePath(args[0], filepath.FromSlash(paths[1]))
mockPath = determinePath(args[1], filepath.FromSlash(paths[0]))
}
cfg.Paths = []string{basePath, mockPath}
cfg.StylesPath = basePath
} else {
Expand Down

0 comments on commit a61c1d2

Please sign in to comment.