diff --git a/internal/core/config.go b/internal/core/config.go index d205634c..58bd3237 100644 --- a/internal/core/config.go +++ b/internal/core/config.go @@ -176,12 +176,8 @@ func NewConfig(flags *CLIFlags) (*Config, error) { cfg.Paths = []string{""} cfg.ConfigFiles = []string{} - found, err := DefaultStylesPath() - if err != nil { - return &cfg, err - } - - if !flags.IgnoreGlobal { + found, _ := DefaultStylesPath() + if !flags.IgnoreGlobal && IsDir(found) { cfg.StylesPath = found cfg.Paths = []string{found} } @@ -242,11 +238,7 @@ func GetStylesPath(src string) (string, error) { if err != nil { return "", err } - - fallback, err := DefaultStylesPath() - if err != nil { - return "", err - } + fallback, _ := DefaultStylesPath() core := uCfg.Section("") return core.Key("StylesPath").MustString(fallback), nil diff --git a/internal/core/source.go b/internal/core/source.go index 762b84a5..a8413fbc 100644 --- a/internal/core/source.go +++ b/internal/core/source.go @@ -196,10 +196,7 @@ func loadINI(cfg *Config, dry bool) (*ini.File, error) { // // In other words, this config file is *always* loaded and is read after // any other sources to allow for project-agnostic customization. - defaultCfg, err := DefaultConfig() - if err != nil { - return nil, err - } + defaultCfg, _ := DefaultConfig() if FileExists(defaultCfg) && !cfg.Flags.IgnoreGlobal && !dry { err = uCfg.Append(defaultCfg)