From a70556ed56e47873fe6697fb5c7c7e2a8c14be8c Mon Sep 17 00:00:00 2001 From: Lei Nelissen Date: Sun, 11 Feb 2024 16:57:27 +0100 Subject: [PATCH] fix: only remove native.tar when it exists --- packages/downloader/src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/downloader/src/index.ts b/packages/downloader/src/index.ts index 241c3a5..5000329 100644 --- a/packages/downloader/src/index.ts +++ b/packages/downloader/src/index.ts @@ -141,13 +141,15 @@ export async function downloadBinaries(version: string, arch: string, platform: console.error(tarOutput.output); throw new Error('Failed to extract tar with binaries...'); } + + // Delete the intermediate format + await fs.unlink('native.tar'); } else { // Abort to the user when unpacking utilities are missing throw new Error('Failed to unpack as system packages are missing. Please install both the "tar" and "xz" / "zstd" utils'); } - // Remove the file - await fs.unlink('native.tar'); + // Remove the archive await fs.unlink('native.txz'); return true;