Skip to content

Commit

Permalink
fix: only remove native.tar when it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
leinelissen committed Feb 11, 2024
1 parent eac6820 commit a70556e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/downloader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a70556e

Please sign in to comment.