Resolve implements interface
(ctx devspacecontext.Context, options ResolveOptions)
| 63 | |
| 64 | // Resolve implements interface |
| 65 | func (r *resolver) Resolve(ctx devspacecontext.Context, options ResolveOptions) ([]types.Dependency, error) { |
| 66 | currentWorkingDirectory, err := os.Getwd() |
| 67 | if err != nil { |
| 68 | return nil, errors.Wrap(err, "get current working directory") |
| 69 | } |
| 70 | |
| 71 | // r.DependencyGraph.Root.ID == name here |
| 72 | err = r.resolveRecursive(ctx, currentWorkingDirectory, r.DependencyGraph.Root.ID, nil, transformMap(r.BaseConfig.Dependencies), options) |
| 73 | if err != nil { |
| 74 | if _, ok := err.(*graph.CyclicError); ok { |
| 75 | return nil, err |
| 76 | } |
| 77 | |
| 78 | return nil, err |
| 79 | } |
| 80 | |
| 81 | // Save local cache |
| 82 | err = r.BaseCache.Save() |
| 83 | if err != nil { |
| 84 | return nil, err |
| 85 | } |
| 86 | |
| 87 | // get direct children |
| 88 | children := []types.Dependency{} |
| 89 | for _, v := range r.DependencyGraph.Root.Childs { |
| 90 | children = append(children, v.Data.(*Dependency)) |
| 91 | } |
| 92 | |
| 93 | return children, nil |
| 94 | } |
| 95 | |
| 96 | func (r *resolver) WithParser(parser loader.Parser) ResolverInterface { |
| 97 | if r == nil { |
nothing calls this directly
no test coverage detected