(absolutePathToDir: string)
| 76 | }; |
| 77 | |
| 78 | function ensureDirExists(absolutePathToDir: string) { |
| 79 | if (fs.existsSync(absolutePathToDir)) { |
| 80 | if (!fs.statSync(absolutePathToDir).isDirectory()) { |
| 81 | throw new Error(`'${absolutePathToDir}' exists and is not a directory.`); |
| 82 | } |
| 83 | } else { |
| 84 | const parentDir = path.dirname(absolutePathToDir); |
| 85 | ensureDirExists(parentDir); |
| 86 | fs.mkdirSync(absolutePathToDir); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | function write(fileName: string, content: string) { |
| 91 | const absolutePathToFile = path.resolve(basePath, fileName); |
no test coverage detected
searching dependent graphs…