(pathname: string)
| 9 | * target cannot be resolved. |
| 10 | */ |
| 11 | export const normalizeAndResolvePath = (pathname: string): string => { |
| 12 | if (isSymbolicLink(pathname)) { |
| 13 | const absPath = path.dirname(pathname) |
| 14 | const targetPath = path.resolve(absPath, readlinkSync(pathname)) |
| 15 | if (isFile(targetPath) || isDirectory(targetPath)) { |
| 16 | return path.resolve(targetPath) |
| 17 | } |
| 18 | console.error(`Cannot resolve link target "${pathname}" (${targetPath}).`) |
| 19 | return '' |
| 20 | } |
| 21 | return path.resolve(pathname) |
| 22 | } |
| 23 | |
| 24 | export const writeFile = ( |
| 25 | pathname: string, |
no test coverage detected