(path string, c *Config)
| 92 | return loadJSON(userConfig, c) |
| 93 | } |
| 94 | func loadOverrideSettings(path string, c *Config) error { |
| 95 | if path == "" { |
| 96 | return nil // no config path passed |
| 97 | } |
| 98 | |
| 99 | if strings.HasPrefix(path, "~/") { |
| 100 | userHome, _ := os.UserHomeDir() // ignore rare cases when user home is undefined |
| 101 | path = filepath.Join(userHome, path) |
| 102 | } |
| 103 | return loadJSON(path, c) |
| 104 | } |
| 105 | |
| 106 | func loadJSON(path string, c *Config) error { |
| 107 | b, err := os.ReadFile(path) |
no test coverage detected