-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
38 lines (33 loc) · 785 Bytes
/
Copy pathindex.js
File metadata and controls
38 lines (33 loc) · 785 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
28
29
30
31
32
33
34
35
36
37
38
/* eslint-disable node/no-unpublished-require */
/* eslint-disable node/no-missing-require */
/* eslint-disable import/no-unresolved */
/* eslint-disable global-require */
let addon;
try {
addon = require('./build/DerivedData/binding/Build/Products/Debug/eac.node');
} catch (ex1) {
assertError(ex1);
try {
addon = require('./build/DerivedData/binding/Build/Products/Release/eac.node');
} catch (ex2) {
assertError(ex2);
}
}
if (!addon) {
try {
addon = require('./build/Debug/eac.node');
} catch (ex1) {
assertError(ex1);
try {
addon = require('./build/Release/eac.node');
} catch (ex2) {
assertError(ex2);
}
}
}
module.exports = addon;
function assertError(ex) {
if (ex.code !== 'MODULE_NOT_FOUND') {
throw ex;
}
}