( fileName: string, targetPath: string, mode?: number )
| 107 | } |
| 108 | |
| 109 | export async function resolveReadPath( |
| 110 | fileName: string, |
| 111 | targetPath: string, |
| 112 | mode?: number |
| 113 | ): Promise<string> { |
| 114 | await migrateLegacyFile(fileName, targetPath, mode); |
| 115 | if (await exists(targetPath)) { |
| 116 | return targetPath; |
| 117 | } |
| 118 | const legacyPath = getLegacyFilePath(fileName); |
| 119 | return (await exists(legacyPath)) ? legacyPath : targetPath; |
| 120 | } |
| 121 | |
| 122 | async function exists(filePath: string): Promise<boolean> { |
| 123 | try { |
no test coverage detected