( ctx context.Context, path core.ModTreePath, include []string, )
| 794 | } |
| 795 | |
| 796 | func matchWorkspaceIncludePath( |
| 797 | ctx context.Context, |
| 798 | path core.ModTreePath, |
| 799 | include []string, |
| 800 | ) (bool, error) { |
| 801 | if len(include) == 0 { |
| 802 | return true, nil |
| 803 | } |
| 804 | if len(path) == 0 { |
| 805 | return false, nil |
| 806 | } |
| 807 | for _, pattern := range include { |
| 808 | if match, err := path.Glob(ctx, pattern); err != nil { |
| 809 | return false, err |
| 810 | } else if match { |
| 811 | return true, nil |
| 812 | } |
| 813 | patternAsPath := core.NewModTreePath(pattern) |
| 814 | if patternAsPath.Contains(ctx, path) { |
| 815 | return true, nil |
| 816 | } |
| 817 | } |
| 818 | return false, nil |
| 819 | } |
| 820 | |
| 821 | func currentWorkspacePrimaryModules(ctx context.Context) ([]dagql.ObjectResult[*core.Module], error) { |
| 822 | query, err := core.CurrentQuery(ctx) |
no test coverage detected