mirror of https://github.com/aminya/setup-cpp
fix: use the returned binDir from extractFunction
This commit is contained in:
parent
d5d332b54c
commit
57de2d5de2
|
@ -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}`)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue