checkExistence stats each file path relative to projectRoot and sets Exists and IsDir.
(files []FileEntry, projectRoot string)
| 154 | |
| 155 | // checkExistence stats each file path relative to projectRoot and sets Exists and IsDir. |
| 156 | func checkExistence(files []FileEntry, projectRoot string) { |
| 157 | for i := range files { |
| 158 | fullPath := filepath.Join(projectRoot, files[i].Path) |
| 159 | info, err := os.Stat(fullPath) |
| 160 | files[i].Exists = err == nil |
| 161 | if err == nil { |
| 162 | files[i].IsDir = info.IsDir() |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | // expandDirectories replaces directory entries with their individual files recursively. |
| 168 | // It skips known junk directories and gitignored files. |