MCPcopy Create free account
hub / github.com/docker/cli / validateContextDir

Function validateContextDir

cli/command/plugin/create.go:44–59  ·  view source on GitHub ↗

validateContextDir validates the given dir and returns its absolute path on success.

(contextDir string)

Source from the content-addressed store, hash-verified

42
43// validateContextDir validates the given dir and returns its absolute path on success.
44func validateContextDir(contextDir string) (string, error) {
45 absContextDir, err := filepath.Abs(contextDir)
46 if err != nil {
47 return "", err
48 }
49 stat, err := os.Lstat(absContextDir)
50 if err != nil {
51 return "", err
52 }
53
54 if !stat.IsDir() {
55 return "", errors.New("context must be a directory")
56 }
57
58 return absContextDir, nil
59}
60
61type pluginCreateOptions struct {
62 repoName string

Callers 1

runCreateFunction · 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…