(ctx context.Context, path string)
| 2049 | } |
| 2050 | |
| 2051 | func (fs ModuleSourceStatFS) Stat(ctx context.Context, path string) (string, *Stat, error) { |
| 2052 | if fs.src == nil { |
| 2053 | return "", nil, os.ErrNotExist |
| 2054 | } |
| 2055 | |
| 2056 | switch fs.src.Kind { |
| 2057 | case ModuleSourceKindLocal: |
| 2058 | path = filepath.Join(fs.src.Local.ContextDirectoryPath, fs.src.SourceRootSubpath, path) |
| 2059 | return CallerStatFS{fs.bk}.Stat(ctx, path) |
| 2060 | case ModuleSourceKindGit: |
| 2061 | path = filepath.Join("/", fs.src.SourceRootSubpath, path) |
| 2062 | return CallDirStat(ctx, fs.src.Git.UnfilteredContextDir, path) |
| 2063 | case ModuleSourceKindDir: |
| 2064 | path = filepath.Join("/", fs.src.SourceRootSubpath, path) |
| 2065 | return CallDirStat(ctx, fs.src.ContextDirectory, path) |
| 2066 | default: |
| 2067 | return "", nil, fmt.Errorf("unsupported module source kind: %s", fs.src.Kind) |
| 2068 | } |
| 2069 | } |
| 2070 | |
| 2071 | func (fs ModuleSourceStatFS) Exists(ctx context.Context, path string) (string, bool, error) { |
| 2072 | if fs.src == nil { |
nothing calls this directly
no test coverage detected