fix: catch the failure in setupBin

This commit is contained in:
Amin Yahyaabadi 2021-09-17 13:51:29 -05:00
parent 5cffd3930a
commit 21b816c605
3 changed files with 13 additions and 9 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -45,13 +45,17 @@ export async function setupBin(
const { url, binRelativeDir, extractedFolderName, extractFunction } = await getPackageInfo(version, process.platform)
// Restore from cache (if found).
const dir = find(name, version)
if (dir) {
info(`${name} ${version} was found in the cache.`)
const installDir = join(dir, extractedFolderName)
const binDir = join(installDir, binRelativeDir)
addPath(binDir)
return { installDir, binDir }
try {
const dir = find(name, version)
if (dir) {
info(`${name} ${version} was found in the cache.`)
const installDir = join(dir, extractedFolderName)
const binDir = join(installDir, binRelativeDir)
addPath(binDir)
return { installDir, binDir }
}
} catch {
// fails on a local machine?
}
// Get an unique output directory name from the URL.