MCPcopy
hub / github.com/cloudfoundry/cli / SetConfig

Function SetConfig

integration/helpers/config.go:90–98  ·  view source on GitHub ↗

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))

Source from the content-addressed store, hash-verified

88// SetConfig allows for a given function to modify a CF config JSON and writes
89// the result back down to the filesystem.
90func 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".
101func SetConfigContent(dir string, rawConfig string) {

Calls 2

LoadConfigFunction · 0.92
WriteConfigMethod · 0.65

Tested by

no test coverage detected