<commit_before>(function() {
  'use strict';

  var inquirer = require('inquirer');
  var generator = require('./Generator');
  var questions = require('./questions');

  function clear() {
    process.stdout.write('\u001b[2J\u001b[0;0H');
  }

  function go(questions, success) {
    clear();
    inquirer.prompt(questions, function(answers) {
      inquirer.prompt([{
        type: 'confirm',
        name: 'confirm',
        message: function() {
          clear();
          return 'Please confirm that your answers are correct.\n' +
            JSON.stringify(answers, null, '  ') +
            '\nAre these answers correct?';
        },
        default: true
      }], function(confirmation) {
        if (!confirmation.confirm) {
          // load existing answers as defaults into questions so user is modifying,
          // not starting from scratch
          questions.map(function(question) {
            question.default = answers[question.name];
          });
          go(questions, success);
        } else {
          success(answers);
        }
      });
    });
  }

  go(questions, function(answers) {
    console.log('Generating playbook for an app named ' + answers.appName + ' in ./ansible...');
    generator.generate(answers);

    console.log('... done! Check out ./ansible for your playbook.');
    console.log('Please make sure that you update ansible/' + answers.appPem);
  });

}());<commit_msg>Notifies if ansible is not installed<commit_after>(function() {
  'use strict';

  var inquirer = require('inquirer');
  var generator = require('./Generator');
  var questions = require('./questions');

  function clear() {
    process.stdout.write('\u001b[2J\u001b[0;0H');
  }

  function go(questions, success) {
    clear();
    inquirer.prompt(questions, function(answers) {
      inquirer.prompt([{
        type: 'confirm',
        name: 'confirm',
        message: function() {
          clear();
          return 'Please confirm that your answers are correct.\n' +
            JSON.stringify(answers, null, '  ') +
            '\nAre these answers correct?';
        },
        default: true
      }], function(confirmation) {
        if (!confirmation.confirm) {
          // load existing answers as defaults into questions so user is modifying,
          // not starting from scratch
          questions.map(function(question) {
            question.default = answers[question.name];
          });
          go(questions, success);
        } else {
          success(answers);
        }
      });
    });
  }

  go(questions, function(answers) {
    console.log('Generating playbook for an app named ' + answers.appName + ' in ./ansible...');
    generator.generate(answers);

    console.log('... done! Check out ./ansible for your playbook.');
    console.log('Please make sure that you update ansible/' + answers.appPem);
    isAnsibleInstalled();
  });

  function isAnsibleInstalled(){
    var exec = require('child_process').exec;
    var cmd = "ansible --version";

    exec(cmd, function(err, stdout, stderr){
      if(err) console.log("Ansible does not appear to be installed correctly. Please install ansible.");
    });
  }

}());
{'fraction_non_alphanumeric': 0.14038401007239534, 'fraction_numerical': 0.0056657223796034, 'mean_word_length': 2.4025695931477515, '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': '7107249', 'n_tokens_mistral': 925, 'n_tokens_neox': 877, 'n_words': 227}