(rootPath: string)
| 311 | } |
| 312 | |
| 313 | function formatProjectLabel(rootPath: string): string { |
| 314 | const knownRootLabel = getKnownRootLabel(rootPath); |
| 315 | if (knownRootLabel) { |
| 316 | return knownRootLabel; |
| 317 | } |
| 318 | |
| 319 | const containingRoot = getContainingKnownRoot(rootPath); |
| 320 | if (containingRoot) { |
| 321 | const relativePath = path.relative(containingRoot, rootPath); |
| 322 | if (!relativePath) { |
| 323 | return getKnownRootLabel(containingRoot) ?? (path.basename(rootPath) || rootPath); |
| 324 | } |
| 325 | return relativePath.replace(/\\/g, '/'); |
| 326 | } |
| 327 | return path.basename(rootPath) || rootPath; |
| 328 | } |
| 329 | |
| 330 | function getRelativeProjectPath(rootPath: string): string | undefined { |
| 331 | const containingRoot = getContainingKnownRoot(rootPath); |
no test coverage detected