diff --git a/packages/cdk-assets/lib/private/archive.ts b/packages/cdk-assets/lib/private/archive.ts index 99f8e8de524be..b54de7590f67b 100644 --- a/packages/cdk-assets/lib/private/archive.ts +++ b/packages/cdk-assets/lib/private/archive.ts @@ -12,8 +12,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 outputFileDirectory = path.dirname(outputFile); - const temporaryOutputFile = `${outputFileDirectory}${path.sep}${randomUUID()}._tmp`; + const temporaryOutputFile = `${outputFile}.${randomUUID()}._tmp`; await writeZipFile(directory, temporaryOutputFile); await moveIntoPlace(temporaryOutputFile, outputFile, logger); }