Merge pull request #1278 from actions/fhammerl/node-v16-and-toolkit-fixes

Migrate dev environment and workflows to node16
This commit is contained in:
Ferenc Hammerl authored and GitHub committed 2023-01-03 14:02:07 +01:00
commit 67eeac2dd0
1 file changed
+7
+7
View File
@@ -219,6 +219,13 @@ export class DownloadHttpClient {
fileDownloadPath: string
): Promise<void> => {
destinationStream.close()
// await until file is created at downloadpath; node15 and up fs.createWriteStream had not created a file yet
await new Promise<void>(resolve => {
destinationStream.on('close', resolve)
if (destinationStream.writableFinished) {
resolve()
}
})
await rmFile(fileDownloadPath)
destinationStream = fs.createWriteStream(fileDownloadPath)
}