MCPcopy
hub / github.com/docker/compose / findExecutable

Function findExecutable

pkg/e2e/framework.go:202–218  ·  pkg/e2e/framework.go::findExecutable
(executableName string)

Source from the content-addressed store, hash-verified

200}
201
202func findExecutable(executableName string) (string, error) {
203 bin := os.Getenv("COMPOSE_E2E_BIN_PATH")
204 if bin == "" {
205 _, filename, _, _ := runtime.Caller(0)
206 buildPath := filepath.Join(filepath.Dir(filename), "..", "..", "bin", "build")
207 var err error
208 bin, err = filepath.Abs(filepath.Join(buildPath, executableName))
209 if err != nil {
210 return "", err
211 }
212 }
213
214 if _, err := os.Stat(bin); err == nil {
215 return bin, nil
216 }
217 return "", fmt.Errorf("looking for %q: %w", bin, fs.ErrNotExist)
218}
219
220func findPluginExecutable(pluginExecutableName string) (string, error) {
221 dockerUserDir := ".docker/cli-plugins"

Calls 1

DirMethod · 0.45