(ctx context.Context, base *dagger.ModuleSource, m map[string]*dagger.ModuleSource)
| 980 | } |
| 981 | |
| 982 | func collectLocalModulesRecursive(ctx context.Context, base *dagger.ModuleSource, m map[string]*dagger.ModuleSource) error { |
| 983 | kind, err := base.Kind(ctx) |
| 984 | if err != nil { |
| 985 | return err |
| 986 | } |
| 987 | if kind != dagger.ModuleSourceKindLocalSource { |
| 988 | return nil |
| 989 | } |
| 990 | |
| 991 | contextDirPath, err := base.LocalContextDirectoryPath(ctx) |
| 992 | if err != nil { |
| 993 | return localModuleErrorf("failed to get local context directory path: %w", err) |
| 994 | } |
| 995 | srcRootSubPath, err := base.SourceRootSubpath(ctx) |
| 996 | if err != nil { |
| 997 | return fmt.Errorf("failed to get source root subpath: %w", err) |
| 998 | } |
| 999 | srcRootAbsPath := filepath.Join(contextDirPath, srcRootSubPath) |
| 1000 | |
| 1001 | if _, ok := m[srcRootAbsPath]; ok { |
| 1002 | return nil // already collected |
| 1003 | } |
| 1004 | m[srcRootAbsPath] = base |
| 1005 | |
| 1006 | deps, err := base.Dependencies(ctx) |
| 1007 | if err != nil { |
| 1008 | return err |
| 1009 | } |
| 1010 | for _, dep := range deps { |
| 1011 | err := collectLocalModulesRecursive(ctx, &dep, m) |
| 1012 | if err != nil { |
| 1013 | return err |
| 1014 | } |
| 1015 | } |
| 1016 | return nil |
| 1017 | } |
| 1018 | |
| 1019 | const daDaggerverse = "https://daggerverse.dev" |
| 1020 |
no test coverage detected