// TODO: get phantomjs e2e working
//
// var selVer = '2.43.1';
// var pconfig = require('protractor/config.json');
//
// if (pconfig.webdriverVersions.selenium !== selVer) {
//   console.log(
//     'Configuring protractor to use Selenium Server version ' +
//     selVer + ' for PhantomJS support...'
//   );
//   pconfig.webdriverVersions.selenium = selVer;
//   require('fs').writeFileSync(
//     'node_modules/protractor/config.json', JSON.stringify(pconfig)
//   );
//   console.log('...done.');
// }

// run bower install in browser dir

var path = require('path');
var del = require('del');
var shelljs = require('shelljs');

del(
  'bower_components',
  {},
  function (err) {
    if (err) {
      console.log('Unable to clear browser\'s bower_components directory.');
      return process.exit(1);
    }

    shelljs.cd('browser');
    shelljs.exec(
      'node ' + path.normalize('../node_modules/bower/bin/bower') + ' install'
    );
    shelljs.cd('..');
  }
);

@@ -627,16 +627,114 @@
 lljs');%0A
+var chalk = require('chalk');%0A%0Aconsole.log(chalk.green('Samplestack: fetching bower_components'));
 %0Adel(%0A  
@@ -734,16 +734,24 @@
 del(%0A  '
+browser/
 bower_co
@@ -1067,16 +1067,199 @@
 d('..');
+%0A%0A    console.log(chalk.green('Samplestack: cleaning up unused directories'));%0A    del(%5B%0A      'browser/dev-tasks',%0A      'browser/node_modules',%0A      'browser/npm-debug.log'%0A    %5D);
 %0A  %7D%0A);%0A

clean up after old codebase