(ctx context.Context, name string)
| 1011 | } |
| 1012 | |
| 1013 | func (h *shellCallHandler) GetDependency(ctx context.Context, name string) (*ShellState, *moduleDef, error) { |
| 1014 | modDef := h.GetDef(nil) |
| 1015 | if !modDef.HasModule() { |
| 1016 | return nil, nil, fmt.Errorf("module not loaded") |
| 1017 | } |
| 1018 | dep := modDef.GetDependency(name) |
| 1019 | if dep == nil { |
| 1020 | return nil, nil, fmt.Errorf("dependency %q not found", name) |
| 1021 | } |
| 1022 | def, err := h.getOrInitDef(dep.SourceDigest, func() (*moduleDef, error) { |
| 1023 | return initializeModule(ctx, h.dag, dep.SourceRoot, dep.Source) |
| 1024 | }) |
| 1025 | if err != nil { |
| 1026 | return nil, nil, err |
| 1027 | } |
| 1028 | st := h.newModState(dep.SourceDigest) |
| 1029 | return &st, def, nil |
| 1030 | } |
| 1031 | |
| 1032 | func (h *shellCallHandler) debugLoadedModules() []string { |
| 1033 | return slices.Collect(h.loadedModuleValues(func(def *moduleDef) string { |
nothing calls this directly
no test coverage detected