From 084f539df9f971e70c4d401ec00d7d24296d16dc Mon Sep 17 00:00:00 2001 From: corymhall <43035978+corymhall@users.noreply.github.com> Date: Fri, 3 Feb 2023 16:30:24 +0000 Subject: [PATCH] Revert "fix(cdk-assets): concurrent asset builds can leave a corrupted archive (#23677)" This reverts commit 18e0481a3bbcb92bd22ce4e83d4f02e03e484307. --- packages/cdk-assets/lib/private/archive.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/cdk-assets/lib/private/archive.ts b/packages/cdk-assets/lib/private/archive.ts index b54de7590f67b..a3922d4d59dba 100644 --- a/packages/cdk-assets/lib/private/archive.ts +++ b/packages/cdk-assets/lib/private/archive.ts @@ -1,4 +1,3 @@ -import { randomUUID } from 'crypto'; import { createWriteStream, promises as fs } from 'fs'; import * as path from 'path'; import * as glob from 'glob'; @@ -12,7 +11,7 @@ type Logger = (x: string) => void; export async function zipDirectory(directory: string, outputFile: string, logger: Logger): Promise { // We write to a temporary file and rename at the last moment. This is so that if we are // interrupted during this process, we don't leave a half-finished file in the target location. - const temporaryOutputFile = `${outputFile}.${randomUUID()}._tmp`; + const temporaryOutputFile = `${outputFile}._tmp`; await writeZipFile(directory, temporaryOutputFile); await moveIntoPlace(temporaryOutputFile, outputFile, logger); } @@ -97,4 +96,4 @@ async function pathExists(x: string) { } throw e; } -} +} \ No newline at end of file