Skip to content

Commit

Permalink
Fix #86, Fail to download on x86 Linux
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 18, 2024
1 parent 1f0ad10 commit fb3793c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/utils/download.mts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export async function downloadAndInstallArchive(
try {
let isSuccess = false;

if (process.platform !== "linux" || process.arch !== "arm64") {
if (process.platform !== "linux") {
const undiciRet = await downloadFileUndici(
client,
downloadUrl,
Expand All @@ -250,7 +250,7 @@ export async function downloadAndInstallArchive(
extraCallback,
undiciRet,
extraHeaders
)
);
}
isSuccess = undiciRet;
} else {
Expand Down Expand Up @@ -341,9 +341,8 @@ async function downloadFileUndici(
LoggerSource.downloader,
`Redirecting to ${headers.location.toString()}`
);
resolve(
headers.location.toString()
); // Handle redirects in the calling function
// Handle redirects in the calling function
resolve(headers.location.toString());
}

return writeStream; // Return the Writable stream where data is piped
Expand Down

0 comments on commit fb3793c

Please sign in to comment.