| 397 | } |
| 398 | |
| 399 | func pendingLegacyModule( |
| 400 | ws *workspace.Workspace, |
| 401 | resolveLocalRef func(ws *workspace.Workspace, relPath string) string, |
| 402 | name, source, pin string, |
| 403 | entrypoint bool, |
| 404 | configDefaults map[string]any, |
| 405 | argCustomizations []*modules.ModuleConfigArgument, |
| 406 | ) pendingModule { |
| 407 | kind := core.FastModuleSourceKindCheck(source, pin) |
| 408 | ref := source |
| 409 | if kind == core.ModuleSourceKindLocal { |
| 410 | ref = resolveLocalRef(ws, source) |
| 411 | } |
| 412 | |
| 413 | mod := pendingModule{ |
| 414 | Ref: ref, |
| 415 | RefPin: pin, |
| 416 | Name: name, |
| 417 | Entrypoint: entrypoint, |
| 418 | LegacyDefaultPath: true, |
| 419 | ConfigDefaults: configDefaults, |
| 420 | ArgCustomizations: argCustomizations, |
| 421 | } |
| 422 | if kind == core.ModuleSourceKindLocal { |
| 423 | mod.RefPin = "" |
| 424 | } |
| 425 | return mod |
| 426 | } |
| 427 | |
| 428 | func legacyCallerModuleDir(isLocal bool, moduleDir string) string { |
| 429 | if !isLocal || moduleDir == "" { |