forked from node-opcua/node-opcua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinstall.js
More file actions
30 lines (25 loc) · 856 Bytes
/
Copy pathpostinstall.js
File metadata and controls
30 lines (25 loc) · 856 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
const child_process = require("child_process");
let the_code = 61;
function exec(cmd,callback) {
console.log("Executing " ,cmd);
const child = child_process.exec(cmd,function(err) {});
child.stdout.pipe(process.stdout);
child.on('close', function(code) {
the_code = code;
console.log("done ... (" + the_code + ")");
callback(code);
});
}
const node = "babel-node ";
exec( node + " bin/generate_opcua_classes.js --clear ",function(result) {
if(result) {
console.log(" Generate OPC CLASSES has failed with error: ",result)
}
exec( node + " bin/crypto_create_CA.js demo",function(result) {
if(result) {
console.log(" Certificate generation has failed with error: ",result)
} else {
console.log('demo certificates generated !');
}
});
});