forked from noble/bleno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.js
39 lines (28 loc) · 935 Bytes
/
install.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
35
36
37
38
39
var os = require('os');
var spawn = require('child_process').spawn;
var platform = os.platform();
console.log('bleno install: platform is "' + platform + "'");
var npmInstall = function(package, callback) {
};
if (platform === 'darwin') {
console.log('bleno install: installing xpc-connection ...');
var npmInstall = spawn('npm', ['install', 'xpc-connection@~0.0.3'], {
stdio: 'inherit'
});
npmInstall.on('close', function(code) {
console.log('bleno install: done');
process.exit(code);
});
} else if (platform === 'linux') {
console.log('bleno install: running node-gyp ...');
var nodeGypConfigureBuild = spawn('node-gyp', ['configure', 'build'], {
stdio: 'inherit'
});
nodeGypConfigureBuild.on('close', function(code) {
console.log('bleno install: done');
process.exit(code);
});
} else {
console.error('bleno install: Your platform is not supported!');
process.exit(-1);
}