LoadOld reads the config file as the old format (with embedded credentials). Used only during migration.
()
| 207 | // LoadOld reads the config file as the old format (with embedded credentials). |
| 208 | // Used only during migration. |
| 209 | func LoadOld() (*OldConfig, error) { |
| 210 | path := globalConfigPath() |
| 211 | |
| 212 | data, err := os.ReadFile(path) |
| 213 | if err != nil { |
| 214 | return nil, err |
| 215 | } |
| 216 | |
| 217 | var cfg OldConfig |
| 218 | if err := json.Unmarshal(data, &cfg); err != nil { |
| 219 | return nil, err |
| 220 | } |
| 221 | return &cfg, nil |
| 222 | } |
| 223 | |
| 224 | func (c *Config) Save() error { |
| 225 | path := globalConfigPath() |
no test coverage detected