MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Save

Function Save

pkg/devspace/config/loader/save.go:12–30  ·  view source on GitHub ↗

Save writes the data of a config to its yaml file

(path string, config *latest.Config)

Source from the content-addressed store, hash-verified

10
11// Save writes the data of a config to its yaml file
12func Save(path string, config *latest.Config) error {
13 var buffer bytes.Buffer
14
15 yamlEncoder := yaml.NewEncoder(&buffer)
16 yamlEncoder.SetIndent(2)
17
18 err := yamlEncoder.Encode(config)
19 if err != nil {
20 return err
21 }
22
23 // Path to save the configuration to
24 err = os.WriteFile(path, buffer.Bytes(), os.ModePerm)
25 if err != nil {
26 return err
27 }
28
29 return nil
30}

Callers 3

initDevspaceMethod · 0.92
initDockerComposeMethod · 0.92
renderMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected