<commit_before>'use strict';

var path = require('path'),
    fs = require('fs'),
    extend = require('extend');

function beforeInstall(config, utils, next) {
  utils.log('► Write configurations file... ');

  config.package = extend(true, {
    name: config.install.name,
    version: '0.0.0',
    description: config.install.description,
    author: config.install.author,
    dependencies: {
      'forever-monitor': '^1.5.2'
    },
    main: 'gulpfile.js',
    private: config.install.private,
    scripts: {
      prestart: 'npm install',
      start: 'node start'
    }
  }, config.package);

  var source = path.resolve(__dirname, 'resources');

  utils.copy(path.join(source, 'ignore'), path.resolve(utils.path, '.gitignore'));
  utils.copy(path.join(source, 'start.js'), path.resolve(utils.path, 'start.js'));

  if (!fs.existsSync(path.resolve(utils.path, 'README.md'))) {
    var readme = utils.getContent(path.join(source, 'README.md')),
        item;

    for (item in config.install) {
      readme = readme.replace(new RegExp('{{' + item + '}}', 'g'), config.install[item]);
    }

    utils.putContent(readme, path.resolve(utils.path, 'README.md'));
  }

  utils.log('[OK]\n');

  next();
}

module.exports = {
  install: [{
    type: 'input',
    name: 'title',
    message: 'Real app name:',
    validate: function(value) {
      return !value ? 'Please give a name.' : true;
    }
  }, {
    type: 'input',
    name: 'name',
    message: 'App code name (lower alphanumerics):',
    validate: function(value) {
      if (value && value.match(/^[a-z]+[a-z0-9-]*$/)) {
        return true;
      }

      return 'Please give a good formated name.';
    }
  }, {
    type: 'input',
    name: 'description',
    message: 'Description:'
  }, {
    type: 'input',
    name: 'author',
    message: 'Author:'
  }, {
    type: 'confirm',<commit_msg>fix(configurations): use "plateform" instead of "app" wording<commit_after>'use strict';

var path = require('path'),
    fs = require('fs'),
    extend = require('extend');

function beforeInstall(config, utils, next) {
  utils.log('► Write configurations file... ');

  config.package = extend(true, {
    name: config.install.name,
    version: '0.0.0',
    description: config.install.description,
    author: config.install.author,
    dependencies: {
      'forever-monitor': '^1.5.2'
    },
    main: 'gulpfile.js',
    private: config.install.private,
    scripts: {
      prestart: 'npm install',
      start: 'node start'
    }
  }, config.package);

  var source = path.resolve(__dirname, 'resources');

  utils.copy(path.join(source, 'ignore'), path.resolve(utils.path, '.gitignore'));
  utils.copy(path.join(source, 'start.js'), path.resolve(utils.path, 'start.js'));

  if (!fs.existsSync(path.resolve(utils.path, 'README.md'))) {
    var readme = utils.getContent(path.join(source, 'README.md')),
        item;

    for (item in config.install) {
      readme = readme.replace(new RegExp('{{' + item + '}}', 'g'), config.install[item]);
    }

    utils.putContent(readme, path.resolve(utils.path, 'README.md'));
  }

  utils.log('[OK]\n');

  next();
}

module.exports = {
  install: [{
    type: 'input',
    name: 'title',
    message: 'Real plateform name:',
    validate: function(value) {
      return !value ? 'Please give a name.' : true;
    }
  }, {
    type: 'input',
    name: 'name',
    message: 'Plateform code name (lower alphanumerics):',
    validate: function(value) {
      if (value && value.match(/^[a-z]+[a-z0-9-]*$/)) {
        return true;
      }

      return 'Please give a good formated name.';
    }
  }, {
    type: 'input',
    name: 'description',
    message: 'Description:'
  }, {
    type: 'input',
    name: 'author',
    message: 'Author:'
  }, {
    type: 'confirm',
{'fraction_non_alphanumeric': 0.1865079365079365, 'fraction_numerical': 0.004232804232804233, 'mean_word_length': 2.975814931650894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7580249', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1270, 'n_words': 273}