MCPcopy
hub / github.com/dagger/dagger / GetDependency

Method GetDependency

cmd/dagger/shell_exec.go:1013–1030  ·  view source on GitHub ↗
(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

1011}
1012
1013func (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
1032func (h *shellCallHandler) debugLoadedModules() []string {
1033 return slices.Collect(h.loadedModuleValues(func(def *moduleDef) string {

Callers

nothing calls this directly

Calls 5

GetDefMethod · 0.95
getOrInitDefMethod · 0.95
newModStateMethod · 0.95
initializeModuleFunction · 0.85
HasModuleMethod · 0.80

Tested by

no test coverage detected