Skip to content

Commit 03f040f

Browse files
committed
bugfix: rearrange target chek on node
1 parent 41c05d1 commit 03f040f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bridge/node/js/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ function loadNativeModule(): Native {
4242
function getTarget(): String {
4343
const platform = os.platform().toLowerCase();
4444
const arch = os.arch().toLowerCase();
45-
46-
// Windows
47-
if (platform.includes("win") && arch.includes("x64")) {
48-
return "x86_64-pc-windows-msvc";
49-
45+
5046
// MacOS
51-
} else if (platform.includes("darwin") && arch.includes("x64")) {
47+
if (platform.includes("darwin") && arch.includes("x64")) {
5248
return "x86_64-apple-darwin";
5349
} else if (platform.includes("darwin") && arch.includes("arm64")) {
5450
return "aarch64-apple-darwin";
@@ -58,9 +54,13 @@ function getTarget(): String {
5854
return "x86_64-unknown-linux-gnu";
5955
} else if (platform.includes("linux") && arch.includes("arm64")) {
6056
return "aarch64-unknown-linux-gnu";
57+
58+
// Windows
59+
} else if (platform.includes("win32") && arch.includes("x64")) {
60+
return "x86_64-pc-windows-msvc";
6161
}
6262

63-
throw new Error(
63+
throw new Error(
6464
`Operating System: ${platform} Architecture: ${arch} is not supported!`,
6565
);
6666
}

0 commit comments

Comments
 (0)