* The system set's own real paths, folded. macOS keeps `/etc`, `/tmp` and * `/var` under `/private`, so a project whose real path is `/private/etc` is * `/etc`. Read once: these folders don't move.
()
| 288 | * `/etc`. Read once: these folders don't move. |
| 289 | */ |
| 290 | function sensitiveSystemPaths(): Set<string> { |
| 291 | if (!sensitiveSystemRealPaths) { |
| 292 | sensitiveSystemRealPaths = new Set(); |
| 293 | for (const entry of SENSITIVE_PATHS) { |
| 294 | // Only this platform's entries: on Windows `/` would resolve to the root |
| 295 | // of the current drive and refuse every project at a drive root. |
| 296 | const native = process.platform === 'win32' ? /^[a-z]:\\/.test(entry) : entry.startsWith('/'); |
| 297 | if (!native) continue; |
| 298 | const real = nativeRealPath(entry); |
| 299 | if (real) sensitiveSystemRealPaths.add(foldPathCase(real)); |
| 300 | } |
| 301 | } |
| 302 | return sensitiveSystemRealPaths; |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * The sensitive home folders, folded: as spelled under the home directory, |
no test coverage detected