MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / cloudflaredPath

Function cloudflaredPath

cmd/cloudflared/access/cmd.go:519–532  ·  view source on GitHub ↗

cloudflaredPath pulls the full path of cloudflared on disk

()

Source from the content-addressed store, hash-verified

517
518// cloudflaredPath pulls the full path of cloudflared on disk
519func cloudflaredPath() string {
520 path, err := os.Executable()
521 if err == nil && isFileThere(path) {
522 return path
523 }
524
525 for _, p := range strings.Split(os.Getenv("PATH"), ":") {
526 path := fmt.Sprintf("%s/%s", p, "cloudflared")
527 if isFileThere(path) {
528 return path
529 }
530 }
531 return "cloudflared"
532}
533
534// isFileThere will check for the presence of candidate path
535func isFileThere(candidate string) bool {

Callers 1

sshConfigFunction · 0.85

Calls 1

isFileThereFunction · 0.85

Tested by

no test coverage detected