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

Function GetDependencyByPath

pkg/devspace/dependency/manager.go:210–234  ·  view source on GitHub ↗
(dependencies []types.Dependency, path string)

Source from the content-addressed store, hash-verified

208}
209
210func GetDependencyByPath(dependencies []types.Dependency, path string) types.Dependency {
211 splitted := strings.Split(path, ".")
212
213 var retDependency types.Dependency
214 searchDependencies := dependencies
215 for _, segment := range splitted {
216 var nextDependency types.Dependency
217 for _, dependency := range searchDependencies {
218 if dependency.Name() == segment {
219 nextDependency = dependency
220 break
221 }
222 }
223
224 // not found, exit here
225 if nextDependency == nil {
226 return nil
227 }
228
229 searchDependencies = nextDependency.Children()
230 retDependency = nextDependency
231 }
232
233 return retDependency
234}

Callers 2

RunMethod · 0.92
RunRunMethod · 0.92

Calls 2

ChildrenMethod · 0.95
NameMethod · 0.65

Tested by

no test coverage detected