#!/usr/bin/env node

const fs = require('fs');
const path = require('path');

const command = process.argv[process.argv.length - 1];

/*const exists = (p, throwError) => {
  const doesExist = fs.existsSync(path.resolve(appRootDir.get(), `${p}.js`)) || fs.existsSync(path.resolve(appRootDir.get(), p, 'index.js'));
  if (!doesExist && throwError) throw new Error(`${p} not found in your root dir!`);
  else if (!doesExist) console.log(`${p} not found in your root dir!`);
  return doesExist;
};

exists('server');
exists('app', true);

require('babel-register')({
  presets: [
    [require.resolve('babel-preset-env'), { targets: { node: true } }],
    require.resolve('babel-preset-stage-3'),
    require.resolve('babel-preset-react'),
  ],
  only: [
    path.resolve(__dirname, '..', 'tools'),
    path.resolve(__dirname, '..', 'src'),
    path.resolve(__dirname, '..', 'config'),
    path.resolve(appRootDir.get(), 'universally.config.js')
  ],
});*/

require(path.resolve(__dirname, '..', 'node_modules', 'kyt', 'cli'));

@@ -951,74 +951,340 @@
 */%0A%0A
-require(path.resolve(__dirname, '..', 'node_modules', 'kyt', 'cli')
+if (fs.existsSync(path.resolve(__dirname, '..', 'node_modules', 'kyt', 'cli'))) %7B%0A  require(path.resolve(__dirname, '..', 'node_modules', 'kyt', 'cli'));%0A%7D else if (fs.existsSync(path.resolve(__dirname, '..', '..', 'kyt', 'cli'))) %7B%0A  require(path.resolve(__dirname, '..', '..', 'kyt', 'cli'));%0A%7D else throw new Error('kyt not found'
 );%0A

Fix issues on production