UpdateConfigAtPath writes the configuration to the specified config path.
(configPath string, conf *MainConfig)
| 57 | |
| 58 | // UpdateConfigAtPath writes the configuration to the specified config path. |
| 59 | func UpdateConfigAtPath(configPath string, conf *MainConfig) error { |
| 60 | toSave, encErr := encryptConfigForSave(conf) |
| 61 | if encErr != nil { |
| 62 | return encErr |
| 63 | } |
| 64 | return utils.FileYamlMarshalAndWrite(configPath, toSave) |
| 65 | } |
| 66 | |
| 67 | // decryptConfig decrypts all encrypted fields in the config using the master key. |
| 68 | // Only prompts for the master password if encrypted content is detected. |