MCPcopy Create free account
hub / github.com/tebeka/selenium / findBestPath

Function findBestPath

remote_test.go:65–92  ·  view source on GitHub ↗
(glob string, binary bool)

Source from the content-addressed store, hash-verified

63}
64
65func findBestPath(glob string, binary bool) string {
66 matches, err := filepath.Glob(glob)
67 if err != nil {
68 glog.Warningf("Error globbing %q: %s", glob, err)
69 return ""
70 }
71 if len(matches) == 0 {
72 return ""
73 }
74 // Iterate backwards: newer versions should be sorted to the end.
75 sort.Strings(matches)
76 for i := len(matches) - 1; i >= 0; i-- {
77 path := matches[i]
78 fi, err := os.Stat(path)
79 if err != nil {
80 glog.Warningf("Error statting %q: %s", path, err)
81 continue
82 }
83 if !fi.Mode().IsRegular() {
84 continue
85 }
86 if binary && fi.Mode().Perm()&0111 == 0 {
87 continue
88 }
89 return path
90 }
91 return ""
92}
93
94func setDriverPaths() error {
95 if *selenium3Path == "" {

Callers 1

setDriverPathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…