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

Method Path

util/manifestparser/locator.go:21–39  ·  view source on GitHub ↗
(filepathOrDirectory string)

Source from the content-addressed store, hash-verified

19}
20
21func (loc Locator) Path(filepathOrDirectory string) (string, bool, error) {
22 info, err := os.Stat(filepathOrDirectory)
23 if os.IsNotExist(err) {
24 return "", false, nil
25 } else if err != nil {
26 return "", false, err
27 }
28
29 resolvedFilepathOrDirectory, err := filepath.EvalSymlinks(filepathOrDirectory)
30 if err != nil {
31 return "", false, err
32 }
33
34 if info.IsDir() {
35 return loc.handleDir(resolvedFilepathOrDirectory)
36 }
37
38 return loc.handleFilepath(resolvedFilepathOrDirectory)
39}
40
41func (loc Locator) handleDir(dir string) (string, bool, error) {
42 for _, filename := range loc.FilesToCheckFor {

Callers 1

UnmarshalFlagMethod · 0.95

Calls 3

handleDirMethod · 0.95
handleFilepathMethod · 0.95
IsDirMethod · 0.80

Tested by

no test coverage detected