Skip to content

Commit efa913d

Browse files
committed
Amend downloadFiles loop to a Promise.all to ensure writes are complete
1 parent 8b23d43 commit efa913d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.changeset/free-suns-stand.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/theme': patch
3+
---
4+
5+
Change download files loop to a Promise all to ensure all files are always downloaded and display more accurate progress

packages/theme/src/cli/utilities/theme-downloader.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,5 @@ async function downloadFiles(theme: Theme, fileSystem: ThemeFileSystem, filename
9090
const assets = await fetchThemeAssets(theme.id, filenames, session)
9191
if (!assets) return
9292

93-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
94-
assets.forEach(async (asset: ThemeAsset) => {
95-
await fileSystem.write(asset)
96-
})
93+
await Promise.all(assets.map((asset: ThemeAsset) => fileSystem.write(asset)))
9794
}

0 commit comments

Comments
 (0)