-
Notifications
You must be signed in to change notification settings - Fork 8
/
install.js
34 lines (28 loc) · 814 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
const shell = require('shelljs');
const os = require('os');
if (os.type() === 'Darwin' || os.type() === 'Linux')
{
if(shell.exec('node-gyp rebuild').code !== 0) {
shell.echo('Error: node-gyp failded');
shell.exit(1);
}
if(shell.exec('sh postinstall.sh').code !== 0) {
shell.echo('Error: postinstall.sh script failded');
shell.exit(1);
}
}
else if(os.type() === 'Windows_NT')
{
if(shell.exec('install.cmd').code !== 0) {
shell.echo('Error: install.cmd script failded');
shell.exit(1);
}
if(shell.exec('node-gyp rebuild').code !== 0) {
shell.echo('Error: node-gyp failded');
shell.exit(1);
}
if(shell.exec('postinstall.cmd').code !== 0) {
shell.echo('Error: postinstall.cmd script failded');
shell.exit(1);
}
}