({ views, viewsDirectoryPath }: HandleViewsIOParams)
| 29 | * In case of empty folders, these are deleted silently. |
| 30 | */ |
| 31 | export async function handleViewsIO({ views, viewsDirectoryPath }: HandleViewsIOParams): Promise<void> { |
| 32 | const posixViewsDirectoryPath = pathToPosix(viewsDirectoryPath) |
| 33 | if (views.length === 0) { |
| 34 | await cleanLeftoversIO(posixViewsDirectoryPath) |
| 35 | return |
| 36 | } |
| 37 | |
| 38 | const { viewFilesToKeep } = await createViewsIO(posixViewsDirectoryPath, views) |
| 39 | await cleanLeftoversIO(posixViewsDirectoryPath, viewFilesToKeep) |
| 40 | } |
| 41 | |
| 42 | async function createViewsIO( |
| 43 | viewsDir: string, |
no test coverage detected