MCPcopy Index your code
hub / github.com/spacecloud-io/space-cloud / createConfigFile

Function createConfigFile

space-cli/cmd/modules/all.go:211–225  ·  view source on GitHub ↗
(pos, commandName string, objs []*model.SpecObject)

Source from the content-addressed store, hash-verified

209}
210
211func createConfigFile(pos, commandName string, objs []*model.SpecObject) error {
212 message := ""
213 for _, val := range objs {
214 data, err := yaml.Marshal(val)
215 if err != nil {
216 return err
217 }
218 message = message + string(data) + "---" + "\n"
219 }
220 fileName := fmt.Sprintf("%s-%s.yaml", pos, commandName)
221 if err := ioutil.WriteFile(fileName, []byte(message), 0755); err != nil {
222 return err
223 }
224 return nil
225}

Callers 1

getAllProjectsFunction · 0.85

Calls 1

WriteFileMethod · 0.65

Tested by

no test coverage detected