-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpre-install.js
More file actions
23 lines (17 loc) · 723 Bytes
/
Copy pathpre-install.js
File metadata and controls
23 lines (17 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const {exec} = require("child_process");
if (process.platform === "linux") {
const cmd =
"export vOCC=$(export VERSION_FILE=/usr/include/opencascade/Standard_Version.hxx && grep -i \"#define OCC_VERSION_COMPLETE\" $VERSION_FILE | awk '{gsub(/\"/, \"\", $0); print $3}')" +
"&& echo $vOCC" +
"&& cat binding.gyp | sed -e \"s/vOCC/$vOCC/\" > binding$vOCC.gyp" +
"&& cp binding$vOCC.gyp binding.gyp";
exec(cmd, (error, stdout, stderr) => {
console.log(`stdout: ${stdout}`);
if (error) {
console.log(error);
console.log("ERROR!!!", error.code);
} else {
console.log("done post install rename libs");
}
});
}