-
Notifications
You must be signed in to change notification settings - Fork 724
/
_postinstall.js
42 lines (34 loc) · 1.18 KB
/
_postinstall.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
40
41
42
/*
* _postinstall.js is a script that runs automatically after the `npm install`
*/
// Get platform from node
var os = require('os');
var platform = os.platform();
if (platform === 'darwin' || platform == 'linux') {
// Call child process and execute
var exec = require('child_process').exec;
exec('./node_modules/protractor/bin/webdriver-manager update --versions.chrome=2.24', function (error, stdout, stderr) {
console.log('Setting up Selenium Server');
console.log(stdout);
if (error !== null) {
console.log(error);
} else {
console.log('Selenium Server setup was successful.');
}
});
return;
} else if (platform === 'win32') {
var exec = require('child_process').exec;
exec('node.exe node_modules/protractor/bin/webdriver-manager update --versions.chrome=2.24', function (error, stdout, stderr) {
console.log('Setting up Selenium Server');
console.log(stdout);
if (error !== null) {
console.log(error);
} else {
console.log('Selenium Server setup was successful.');
}
});
return;
}
console.error('Unknown environment. Please log an issue at https://github.com/marmelab/ng-admin/issues:', platform);
process.exit(1);