From eaad560e27191dcb1983adb9cdc925f0d80df1eb Mon Sep 17 00:00:00 2001 From: Chris Barber Date: Thu, 1 Dec 2022 01:12:55 -0600 Subject: [PATCH] Wait until all bundles are written to disk --- src/spack/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spack/index.ts b/src/spack/index.ts index eb1654f..84850e1 100644 --- a/src/spack/index.ts +++ b/src/spack/index.ts @@ -37,7 +37,7 @@ const makeDir = promisify(mkdir); const emitStart = process.hrtime(); if (spackOptions.output?.path) { - await Object.keys(output).map(async (name) => { + await Promise.all(Object.keys(output).map(async (name) => { let fullPath = ''; if (isUserDefinedEntry(name)) { fullPath = join(spackOptions.output.path, spackOptions.output.name.replace('[name]', name)); @@ -53,7 +53,7 @@ const makeDir = promisify(mkdir); if (output[name].map) { await write(`${fullPath}.map`, output[name].map, 'utf-8') } - }); + })); } else { throw new Error('Cannot print to stdout: not implemented yet') } @@ -67,4 +67,4 @@ const makeDir = promisify(mkdir); // } await build(); -})() \ No newline at end of file +})()