Skip to content

Commit 97d7a66

Browse files
🔒 replace predictable temp dir with fs.mkdtemp in zip-entries (#42)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: sunnylqm <615282+sunnylqm@users.noreply.github.com>
1 parent 327b734 commit 97d7a66

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎src/utils/zip-entries.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,9 @@ export async function enumZipEntries(
143143
!entry.fileName.endsWith('/') &&
144144
entry.fileName.toLowerCase().endsWith('.hap')
145145
) {
146-
const tempDir = path.join(
147-
os.tmpdir(),
148-
`nested_zip_${Date.now()}`,
146+
const tempDir = await fs.mkdtemp(
147+
path.join(os.tmpdir(), 'nested_zip_'),
149148
);
150-
await fs.ensureDir(tempDir);
151149
const tempZipPath = path.join(tempDir, 'temp.zip');
152150

153151
await new Promise((res, rej) => {

0 commit comments

Comments
 (0)