Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
SOVLOOKUP committed Oct 16, 2023
1 parent 546f6c2 commit cf35c7e
Showing 1 changed file with 1 addition and 60 deletions.
61 changes: 1 addition & 60 deletions addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,6 @@ function isMusl() {
}

switch (platform) {
case 'android':
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'rubick-native-addon.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./rubick-native-addon.android-arm64.node')
} else {
nativeBinding = require('rubick-native-addon-android-arm64')
}
} catch (e) {
loadError = e
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'rubick-native-addon.android-arm-eabi.node'))
try {
if (localFileExisted) {
nativeBinding = require('./rubick-native-addon.android-arm-eabi.node')
} else {
nativeBinding = require('rubick-native-addon-android-arm-eabi')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Android ${arch}`)
}
break
case 'win32':
switch (arch) {
case 'x64':
Expand Down Expand Up @@ -116,7 +86,7 @@ switch (platform) {
nativeBinding = require('rubick-native-addon-darwin-universal')
}
break
} catch {}
} catch { }
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'rubick-native-addon.darwin-x64.node'))
Expand Down Expand Up @@ -148,21 +118,6 @@ switch (platform) {
throw new Error(`Unsupported architecture on macOS: ${arch}`)
}
break
case 'freebsd':
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'rubick-native-addon.freebsd-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./rubick-native-addon.freebsd-x64.node')
} else {
nativeBinding = require('rubick-native-addon-freebsd-x64')
}
} catch (e) {
loadError = e
}
break
case 'linux':
switch (arch) {
case 'x64':
Expand Down Expand Up @@ -223,20 +178,6 @@ switch (platform) {
}
}
break
case 'arm':
localFileExisted = existsSync(
join(__dirname, 'rubick-native-addon.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./rubick-native-addon.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('rubick-native-addon-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Linux: ${arch}`)
}
Expand Down

0 comments on commit cf35c7e

Please sign in to comment.