SaveMultiAppConfig saves config to disk.
(config *MultiAppConfig)
| 212 | |
| 213 | // SaveMultiAppConfig saves config to disk. |
| 214 | func SaveMultiAppConfig(config *MultiAppConfig) error { |
| 215 | dir := GetConfigDir() |
| 216 | if err := vfs.MkdirAll(dir, 0700); err != nil { |
| 217 | return err |
| 218 | } |
| 219 | data, err := json.MarshalIndent(config, "", " ") |
| 220 | if err != nil { |
| 221 | return err |
| 222 | } |
| 223 | return validate.AtomicWrite(GetConfigPath(), append(data, '\n'), 0600) |
| 224 | } |
| 225 | |
| 226 | // RequireConfig loads the single-app config using the default profile resolution. |
| 227 | func RequireConfig(kc keychain.KeychainAccess) (*CliConfig, error) { |