Skip to content

Commit 21b816c

Browse files
committed
fix: catch the failure in setupBin
1 parent 5cffd39 commit 21b816c

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/setup/setupBin.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ export async function setupBin(
4545
const { url, binRelativeDir, extractedFolderName, extractFunction } = await getPackageInfo(version, process.platform)
4646

4747
// Restore from cache (if found).
48-
const dir = find(name, version)
49-
if (dir) {
50-
info(`${name} ${version} was found in the cache.`)
51-
const installDir = join(dir, extractedFolderName)
52-
const binDir = join(installDir, binRelativeDir)
53-
addPath(binDir)
54-
return { installDir, binDir }
48+
try {
49+
const dir = find(name, version)
50+
if (dir) {
51+
info(`${name} ${version} was found in the cache.`)
52+
const installDir = join(dir, extractedFolderName)
53+
const binDir = join(installDir, binRelativeDir)
54+
addPath(binDir)
55+
return { installDir, binDir }
56+
}
57+
} catch {
58+
// fails on a local machine?
5559
}
5660

5761
// Get an unique output directory name from the URL.

0 commit comments

Comments
 (0)