SetConfig allows for a given function to modify a CF config JSON and writes the result back down to the filesystem.
(cb func(conf *configv3.Config))
| 88 | // SetConfig allows for a given function to modify a CF config JSON and writes |
| 89 | // the result back down to the filesystem. |
| 90 | func SetConfig(cb func(conf *configv3.Config)) { |
| 91 | config, err := configv3.LoadConfig() |
| 92 | Expect(err).ToNot(HaveOccurred()) |
| 93 | |
| 94 | cb(config) |
| 95 | |
| 96 | err = config.WriteConfig() |
| 97 | Expect(err).ToNot(HaveOccurred()) |
| 98 | } |
| 99 | |
| 100 | // SetConfigContent writes given raw config into given directory as "config.json". |
| 101 | func SetConfigContent(dir string, rawConfig string) { |
no test coverage detected