Skip to content

Commit

Permalink
fix(cdk-assets): packaging assets is broken on Node older than 14.17 (#…
Browse files Browse the repository at this point in the history
…23994)

This reverts commit 18e0481.

Closes #23859

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
corymhall committed Feb 3, 2023
1 parent 7f4e35e commit 1976f1a
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 1976f1a

Please sign in to comment.