Skip to content

Commit

Permalink
Create _postinstall.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Phocea committed Dec 8, 2016
1 parent 53c579d commit d13ccc6
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions _postinstall.js
@@ -0,0 +1,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);

0 comments on commit d13ccc6

Please sign in to comment.