Skip to content

Commit bd2e92e

Browse files
aegilopsCopilot
andauthored
Update src/componentDetection.ts
Co-authored-by: Copilot <[email protected]>
1 parent de9be57 commit bd2e92e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/componentDetection.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,16 @@ export default class ComponentDetection {
315315
let downloadURL: string = "";
316316
// TODO: do we need to handle different architectures here?
317317
// can we allow x64 on MacOS? We could allow an input parameter to override?
318-
const assetName = process.platform === "win32" ? "component-detection-win-x64.exe" : process.platform === "linux" ? "component-detection-linux-x64" : "component-detection-osx-arm64";
318+
let assetName: string;
319+
if (process.platform === "win32") {
320+
assetName = "component-detection-win-x64.exe";
321+
} else if (process.platform === "linux") {
322+
assetName = "component-detection-linux-x64";
323+
} else if (process.platform === "darwin") {
324+
assetName = "component-detection-osx-arm64";
325+
} else {
326+
throw new Error(`Unsupported platform: ${process.platform}`);
327+
}
319328
latestRelease.data.assets.forEach((asset: any) => {
320329
if (asset.name === assetName) {
321330
downloadURL = asset.browser_download_url;

0 commit comments

Comments
 (0)