const path = require('path');
const shell = require('shelljs');
const { getCliArgs, getEnvsList } = require('./utils');

const { cd, echo, exec } = shell;
const projectDir = path.resolve(__dirname, '..');

const envFromCli = getCliArgs().env;
const envs = getEnvsList(projectDir);
const envToSelect = envFromCli
  ? envs.find(e => e.name === envFromCli)
  : 'webpack-3';

exec('yarn');
exec(`node ${projectDir}/node_modules/husky/bin/install`);

envs.forEach((env) => {
  cd(env.path);
  exec('yarn');
  echo(`${env.name} env installed`);
});

cd(projectDir);
exec(`node ${projectDir}/scripts/select-env ${envToSelect.name}`);

@@ -350,16 +350,42 @@
 Cli)%0A  :
+ envs.find(e =%3E e.name ===
  'webpac
@@ -388,16 +388,17 @@
 bpack-3'
+)
 ;%0A%0Aexec(

fix bootstrap scripts