forked from jxcore/jxcore-cordova
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (25 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
jxcore.utils.
console.log('Extracting the binaries', 'yellow');
if (process.argv[2] == "EXTRACT") {
var AdmZip = require('adm-zip');
var zip = new AdmZip("./io.jxcore.node/bin/ios.zip");
zip.extractAllToAsync("./io.jxcore.node/bin/", true, function(_, __) { /* DO NOTHING */ });
} else {
require("child_process").execFile(process.execPath, ["io.jxcore.node/index.js", "EXTRACT"],
{cwd: process.cwd()}, function (error, stdout, stderr) {
if (error) {
console.error("Something bad happened with the extraction:\n", stdout, "\n", stderr);
process.exit(1);
}
jxcore.utils.
console.log('DONE\n\nJXcore Cordova Plugin is available under io.jxcore.node/ folder.', 'green');
jxcore.utils.
console.log('type: ', 'yellow');
jxcore.utils.
console.log('cordova plugins add io.jxcore.node/');
jxcore.utils.
console.log('to install the plugin', 'yellow');
require('fs').unlinkSync("io.jxcore.node.jx");
require('fs').unlinkSync("io.jxcore.node/bin/ios.zip");
});
}