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

Function checkIfFileExists

command/flag/path.go:230–242  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

228}
229
230func checkIfFileExists(path string) (os.FileInfo, error) {
231 fileInfo, err := os.Stat(path)
232 if err != nil {
233 if os.IsNotExist(err) {
234 return nil, &flags.Error{
235 Type: flags.ErrRequired,
236 Message: fmt.Sprintf("The specified path '%s' does not exist.", path),
237 }
238 }
239 return nil, err
240 }
241 return fileInfo, nil
242}

Callers 2

UnmarshalFlagMethod · 0.85
UnmarshalFlagMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected