( dirPath: string, zipPath: string, )
| 369 | * same sequence; getting it wrong (non-atomic write, forgetting rm) corrupts cache. |
| 370 | */ |
| 371 | export async function convertDirectoryToZipInPlace( |
| 372 | dirPath: string, |
| 373 | zipPath: string, |
| 374 | ): Promise<void> { |
| 375 | const zipData = await createZipFromDirectory(dirPath) |
| 376 | await atomicWriteToZipCache(zipPath, zipData) |
| 377 | await rm(dirPath, { recursive: true, force: true }) |
| 378 | } |
| 379 | |
| 380 | /** |
| 381 | * Get the relative path for a marketplace JSON file within the zip cache. |
no test coverage detected