(filePath: string)
| 40 | } |
| 41 | |
| 42 | async function existingPathVariant(filePath: string) { |
| 43 | const candidates = [ |
| 44 | filePath, |
| 45 | filePath.replace(/ (AM|PM)\./gi, `${narrowNoBreakSpace}$1.`), |
| 46 | filePath.normalize('NFD'), |
| 47 | filePath.replace(/'/g, '’'), |
| 48 | filePath.normalize('NFD').replace(/'/g, '’'), |
| 49 | ] |
| 50 | for (const candidate of candidates) { |
| 51 | try { |
| 52 | await stat(candidate) |
| 53 | return candidate |
| 54 | } catch { |
| 55 | // Try the next Pi-compatible path variant. |
| 56 | } |
| 57 | } |
| 58 | return filePath |
| 59 | } |
| 60 | |
| 61 | function resolveToolPath(filePath: string, cwd: string) { |
| 62 | const withoutAt = filePath.startsWith('@') ? filePath.slice(1) : filePath |
no outgoing calls
no test coverage detected