forked from RGB-Tools/rgb-lib-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (19 loc) · 699 Bytes
/
index.js
File metadata and controls
24 lines (19 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const os = require("os");
// Currently supported platforms
const supportedCombinations = [
{ platform: "linux", arch: "x64" },
{ platform: "linux", arch: "arm64" },
{ platform: "darwin", arch: "arm64" },
];
const platform = os.platform();
const arch = os.arch();
const isSupported = supportedCombinations.some(
(combo) => combo.platform === platform && combo.arch === arch
);
if (!isSupported) {
console.error(`Unsupported platform-arch: ${platform}-${arch}`);
console.error("Supported combinations: linux-x64, linux-arm64, darwin-arm64");
process.exit(1);
}
let nativePackageName = `@utexo/rgb-lib-${platform}-${arch}`;
module.exports = require(nativePackageName);