Skip to content

Commit

Permalink
Revert "fix(cdk-assets): concurrent asset builds can leave a corrupte…
Browse files Browse the repository at this point in the history
…d archive (#23677)"

This reverts commit 18e0481.
  • Loading branch information
corymhall committed Feb 3, 2023
1 parent affe040 commit 084f539
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/cdk-assets/lib/private/archive.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -12,7 +11,7 @@ type Logger = (x: string) => void;
export async function zipDirectory(directory: string, outputFile: string, logger: Logger): Promise<void> {
// 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);
}
Expand Down Expand Up @@ -97,4 +96,4 @@ async function pathExists(x: string) {
}
throw e;
}
}
}

0 comments on commit 084f539

Please sign in to comment.