forked from SAP-archive/node-rfc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (31 loc) · 1.05 KB
/
index.js
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
'use strict';
var rfc = null;
var plattformPath = null;
if (process.platform === "linux" && process.arch === "x64") {
plattformPath = './build/linux_x64/rfc';
} else if (process.platform === "win32" && process.arch === "x64") {
plattformPath = './build/win32_x64/rfc';
} else {
console.log('Platform not supported', process.platform, process.arch);
}
/* win 32 bit and darwin not supported
} else if (process.platform === "win32" && process.arch === "ia32") {
plattformPath = './build/win32_x86/rfc';
}
else if (process.platform === "darwin" && process.arch === "x64") {
plattformPath = './build/osx_x64/rfc';
} */
if (plattformPath) {
try {
rfc = require(plattformPath);
module.exports = rfc;
} catch (err) {
switch (err.code) {
case 'MODULE_NOT_FOUND':
console.log('Could not load module ' + plattformPath + ' ' + err.toString());
break;
default:
console.log('Error Loading Module - (may SAP RFC Library in path not set?) ' + err.toString());
}
}
}