MCPcopy Index your code
hub / github.com/devspace-sh/devspace / GetDependencyPath

Function GetDependencyPath

pkg/devspace/dependency/util/util.go:39–65  ·  view source on GitHub ↗
(workingDirectory string, source *latest.SourceConfig)

Source from the content-addressed store, hash-verified

37var downloadMutex = sync.Mutex{}
38
39func 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
68func switchURLType(gitPath string) string {

Callers

nothing calls this directly

Calls 3

GetDependencyIDFunction · 0.85
isURLFunction · 0.85
getDependencyConfigPathFunction · 0.85

Tested by

no test coverage detected