forked from norman784/libimobiledevice-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preinstall.js
29 lines (28 loc) · 879 Bytes
/
preinstall.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
const spawn = require('child_process').spawn;
const os = require('os');
if (os.type() === 'Darwin' || os.type() === 'Linux')
{
let macInstaller = spawn('sh', ['install.sh']);
macInstaller.stdout.on('data',(data) => {
console.log(data.toString());
});
macInstaller.stderr.on('data', (data) => {
console.log(data.toString());
});
macInstaller.on('exit', (code) => {
console.log(`Child exited with code ${code}`);
});
}
else if(os.type() === 'Windows_NT')
{
let windowsInstaller = spawn('cmd.exe', ['/c','preinstall.cmd']);
windowsInstaller.stdout.on('data',(data) => {
console.log(data.toString());
});
windowsInstaller.stderr.on('data', (data) => {
console.log(data.toString());
});
windowsInstaller.on('exit', (code) => {
console.log(`Child exited with code ${code}`);
});
}