diff --git a/src/utils/setup/setupBin.ts b/src/utils/setup/setupBin.ts index 362b181e..26903dea 100644 --- a/src/utils/setup/setupBin.ts +++ b/src/utils/setup/setupBin.ts @@ -82,8 +82,8 @@ export async function setupBin( } } - const installDir = join(setupDir, extractedFolderName) - const binDir = join(installDir, binRelativeDir) + let installDir = join(setupDir, extractedFolderName) + let binDir = join(installDir, binRelativeDir) const binFile = join(binDir, binFileName) // download ane extract the package into the installation directory. @@ -113,7 +113,11 @@ export async function setupBin( try { const downloaded = await downloadTool(url) - await extractFunction?.(downloaded, setupDir) + const extractedBinDir = await extractFunction?.(downloaded, setupDir) + if (typeof extractedBinDir === "string") { + binDir = extractedBinDir + installDir = extractedBinDir + } } catch (err) { throw new Error(`Failed to download ${name} ${version} ${arch} from ${url}: ${err}`) }