validateContextDir validates the given dir and returns its absolute path on success.
(contextDir string)
| 42 | |
| 43 | // validateContextDir validates the given dir and returns its absolute path on success. |
| 44 | func 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 | |
| 61 | type pluginCreateOptions struct { |
| 62 | repoName string |
no outgoing calls
no test coverage detected
searching dependent graphs…