MCPcopy Index your code
hub / github.com/cloudfoundry/cli / writeToFile

Method writeToFile

cf/commands/curl.go:146–156  ·  view source on GitHub ↗
(responseBody, filePath string)

Source from the content-addressed store, hash-verified

144}
145
146func (cmd Curl) writeToFile(responseBody, filePath string) (err error) {
147 if _, err = os.Stat(filePath); os.IsNotExist(err) {
148 err = os.MkdirAll(filepath.Dir(filePath), 0755)
149 }
150
151 if err != nil {
152 return
153 }
154
155 return ioutil.WriteFile(filePath, []byte(responseBody), 0644)
156}

Callers 1

ExecuteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected