(workingDirectory string, source *latest.SourceConfig)
| 37 | var downloadMutex = sync.Mutex{} |
| 38 | |
| 39 | func GetDependencyPath(workingDirectory string, source *latest.SourceConfig) (configPath string, err error) { |
| 40 | ID, err := GetDependencyID(source) |
| 41 | if err != nil { |
| 42 | return "", err |
| 43 | } |
| 44 | |
| 45 | // Resolve source |
| 46 | var localPath string |
| 47 | if source.Git != "" { |
| 48 | localPath = filepath.Join(DependencyFolderPath, ID) |
| 49 | } else if source.Path != "" { |
| 50 | if isURL(source.Path) { |
| 51 | localPath = filepath.Join(DependencyFolderPath, ID) |
| 52 | } else { |
| 53 | if filepath.IsAbs(source.Path) { |
| 54 | localPath = source.Path |
| 55 | } else { |
| 56 | localPath, err = filepath.Abs(filepath.Join(workingDirectory, filepath.FromSlash(source.Path))) |
| 57 | if err != nil { |
| 58 | return "", errors.Wrap(err, "filepath absolute") |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | return getDependencyConfigPath(localPath, source) |
| 65 | } |
| 66 | |
| 67 | // switch https <-> ssh urls |
| 68 | func switchURLType(gitPath string) string { |
nothing calls this directly
no test coverage detected