<commit_before>'use strict';
var util = require('util');
var path = require('path');
var yeoman = require('yeoman-generator');
var _ = require('underscore');

var OJGenerator = module.exports = function OJGenerator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);
  this.on('end', function () {
    this.installDependencies({ skipInstall: options['skip-install'] , callback:function(){
      printHelp(this.options.type, this.options.name)
    }.bind(this)});
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(OJGenerator, yeoman.generators.Base);

OJGenerator.prototype.welcome = function welcome() {
  console.log(this.yeoman);
};

OJGenerator.prototype.askFor = function askFor() {
  var done = this.async();

  var promptType = [{
    type: 'list',
    name: 'type',
    message: 'Do you want an Express website or a Static website?',
    choices: [
      'Express website',
      'Static website (The OJ CLI tool)'
    ]
  }];

  var promptCoffee = [{
    type: 'list',
    name: 'coffee',
    message: 'Would you like to use JavaScript or CoffeeScript?',
    choices: [
      'JavaScript',
      'CoffeeScript'
    ]
  }];

  // Default their project name
  this.options.appname = this.options.argv.remain[0] || 'Project Name';

  // Allow --js and --cs to override --coffee flag
  if (this.options.js)
    this.options.coffee = false
  if (this.options.cs)
    this.options.coffee = true

  // Prompt for Coffee if it isn't available
  var checkForCoffee = function(){
    if (this.options.coffee == null) {
      this.prompt(promptCoffee, function(coffeeResponses){
        this.options.coffee = coffeeResponses.coffee.match(/Coffee/i) !== null ? true : false;
        done();
      }.bind(this));
    } else
      done()
  }.bind(this)

  // Prompt for type if not :express, :cli, or :static
  if(this.options.name != 'express' && this.options.name != 'cli' && this.options.name != 'static')
  {
    this.prompt(promptType, function(typeResponses){
      this.options.type = typeResponses.type.match(/^Express$/i) !== null ? 'express' : 'cli';
      checkForCoffee()
    }.bind(this));
  } else {
    this.options.type = this.options.name == 'express' ? 'express' : this.options.name == 'static' ? 'cli' : 'cli'
    checkForCoffee()
  }
};

OJGenerator.prototype.app = function app(){
  var done = this.async();

  // Remember initial paths
  var sourceDir = this.sourceRoot();<commit_msg>Fixing issue with default question<commit_after>'use strict';
var util = require('util');
var path = require('path');
var yeoman = require('yeoman-generator');
var _ = require('underscore');

var OJGenerator = module.exports = function OJGenerator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);
  this.on('end', function () {
    this.installDependencies({ skipInstall: options['skip-install'] , callback:function(){
      printHelp(this.options.type, this.options.name)
    }.bind(this)});
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(OJGenerator, yeoman.generators.Base);

OJGenerator.prototype.welcome = function welcome() {
  console.log(this.yeoman);
};

OJGenerator.prototype.askFor = function askFor() {
  var done = this.async();

  var promptType = [{
    type: 'list',
    name: 'type',
    message: 'Do you want an Express website or a Static website?',
    choices: [
      'Express website',
      'Static website (The OJ CLI tool)'
    ]
  }];

  var promptCoffee = [{
    type: 'list',
    name: 'coffee',
    message: 'Would you like to use JavaScript or CoffeeScript?',
    choices: [
      'JavaScript',
      'CoffeeScript'
    ]
  }];

  // Default their project name
  this.options.appname = this.options.argv.remain[0] || 'Project Name';

  // Allow --js and --cs to override --coffee flag
  if (this.options.js)
    this.options.coffee = false
  if (this.options.cs)
    this.options.coffee = true

  // Prompt for Coffee if it isn't available
  var checkForCoffee = function(){
    if (this.options.coffee == null) {
      this.prompt(promptCoffee, function(coffeeResponses){
        this.options.coffee = coffeeResponses.coffee.match(/Coffee/i) !== null ? true : false;
        done();
      }.bind(this));
    } else
      done()
  }.bind(this)

  // Prompt for type if not :express, :cli, or :static
  if(this.options.name != 'express' && this.options.name != 'cli' && this.options.name != 'static')
  {
    this.prompt(promptType, function(typeResponses){
      this.options.type = typeResponses.type.match(/Express/i) !== null ? 'express' : 'cli';
      checkForCoffee()
    }.bind(this));
  } else {
    this.options.type = this.options.name == 'express' ? 'express' : this.options.name == 'static' ? 'cli' : 'cli'
    checkForCoffee()
  }
};

OJGenerator.prototype.app = function app(){
  var done = this.async();

  // Remember initial paths
  var sourceDir = this.sourceRoot();
{'fraction_non_alphanumeric': 0.1590226316843581, 'fraction_numerical': 0.0004005607850991388, 'mean_word_length': 3.353966870095902, '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': '6017300', 'n_tokens_mistral': 1660, 'n_tokens_neox': 1588, 'n_words': 373}