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

Function findPluginExecutable

pkg/e2e/framework.go:220–244  ·  view source on GitHub ↗
(pluginExecutableName string)

Source from the content-addressed store, hash-verified

218}
219
220func findPluginExecutable(pluginExecutableName string) (string, error) {
221 dockerUserDir := ".docker/cli-plugins"
222 userDir, err := os.UserHomeDir()
223 if err != nil {
224 return "", err
225 }
226 candidates := []string{
227 filepath.Join(userDir, dockerUserDir),
228 "/usr/local/lib/docker/cli-plugins",
229 "/usr/local/libexec/docker/cli-plugins",
230 "/usr/lib/docker/cli-plugins",
231 "/usr/libexec/docker/cli-plugins",
232 }
233 for _, path := range candidates {
234 bin, err := filepath.Abs(filepath.Join(path, pluginExecutableName))
235 if err != nil {
236 return "", err
237 }
238 if _, err := os.Stat(bin); err == nil {
239 return bin, nil
240 }
241 }
242
243 return "", fmt.Errorf("plugin not found %s: %w", pluginExecutableName, os.ErrNotExist)
244}
245
246// CopyFile copies a file from a sourceFile to a destinationFile setting permissions to 0755
247func CopyFile(t testing.TB, sourceFile string, destinationFile string) {

Callers 2

TestComposeModelFunction · 0.85
initializePluginsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestComposeModelFunction · 0.68