'use strict';

const runAll = require('npm-run-all');

const tools = require('../../scripts/utils/tools');
const configUtils = require('../../scripts/csdr/config/config-utils');

const defaultProject = configUtils.projects.getProject();

runAll([
  `app:run-mock ${defaultProject.name}`,
  `app:serve ${defaultProject.name}`
], { stdout: process.stdout})
    .then(() => {
      tools.logSuccess();
    })
    .catch(e => {
      tools.logError('ERROR during execution, see below');
      console.error(e);
      process.exit(1);
    });
