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)
|
let installDir = join(setupDir, extractedFolderName)
|
||||||
const binDir = join(installDir, binRelativeDir)
|
let binDir = join(installDir, binRelativeDir)
|
||||||
const binFile = join(binDir, binFileName)
|
const binFile = join(binDir, binFileName)
|
||||||
|
|
||||||
// download ane extract the package into the installation directory.
|
// download ane extract the package into the installation directory.
|
||||||
|
@ -113,7 +113,11 @@ export async function setupBin(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const downloaded = await downloadTool(url)
|
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) {
|
} catch (err) {
|
||||||
throw new Error(`Failed to download ${name} ${version} ${arch} from ${url}: ${err}`)
|
throw new Error(`Failed to download ${name} ${version} ${arch} from ${url}: ${err}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue