From a600dd34a5375a628d0123c69ae54366d8037079 Mon Sep 17 00:00:00 2001 From: Yang Cao Date: Thu, 3 Dec 2020 13:34:59 -0500 Subject: [PATCH] Try close stream before unlink --- packages/artifact/src/internal/download-http-client.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/artifact/src/internal/download-http-client.ts b/packages/artifact/src/internal/download-http-client.ts index 7fb06a4b..bd409ebb 100644 --- a/packages/artifact/src/internal/download-http-client.ts +++ b/packages/artifact/src/internal/download-http-client.ts @@ -223,6 +223,7 @@ export class DownloadHttpClient { const resetDestinationStream = async ( fileDownloadPath: string ): Promise => { + destinationStream.close() await rmFile(fileDownloadPath) destinationStream = fs.createWriteStream(fileDownloadPath) }