forked from getsentry/sentry-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinaries.js
More file actions
27 lines (20 loc) · 976 Bytes
/
Copy pathbinaries.js
File metadata and controls
27 lines (20 loc) · 976 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
25
26
27
const os = require('os');
const path = require('path');
const abi = require('node-abi');
const libc = require('detect-libc');
function getModuleName() {
const stdlib = libc.familySync();
const platform = process.env['BUILD_PLATFORM'] || os.platform();
const arch = process.env['BUILD_ARCH'] || os.arch();
if (platform === 'darwin' && arch === 'arm64') {
const identifier = [platform, 'arm64', abi.getAbi(process.versions.node, 'node')].filter(Boolean).join('-');
return `sentry_cpu_profiler-${identifier}.node`;
}
const identifier = [platform, arch, stdlib, abi.getAbi(process.versions.node, 'node')].filter(Boolean).join('-');
return `sentry_cpu_profiler-${identifier}.node`;
}
const source = path.join(__dirname, '..', 'build', 'Release', 'sentry_cpu_profiler.node');
const target = path.join(__dirname, '..', 'lib', getModuleName());
module.exports.source = source;
module.exports.target = target;
module.exports.getModuleName = getModuleName;