(ctx context.Context, path string, opts ...dagger.ModuleServeOpts)
| 256 | } |
| 257 | |
| 258 | func (h *shellCallHandler) maybeLoadModule(ctx context.Context, path string, opts ...dagger.ModuleServeOpts) (*moduleDef, *configuredModule, error) { |
| 259 | cfg, err := h.parseModRef(ctx, path) |
| 260 | if err != nil { |
| 261 | return nil, cfg, fmt.Errorf("find module %q: %w", path, err) |
| 262 | } |
| 263 | if cfg == nil { |
| 264 | return nil, nil, nil |
| 265 | } |
| 266 | def, err := h.getOrInitDef(cfg.Digest, func() (*moduleDef, error) { |
| 267 | return initializeModule(ctx, h.dag, cfg.Ref, cfg.Source, opts...) |
| 268 | }) |
| 269 | |
| 270 | return def, cfg, err |
| 271 | } |
| 272 | |
| 273 | // parseModRef transforms user input into a full module reference that can be used with |
| 274 | // dag.ModuleSource(). |
no test coverage detected