<commit_before>'use strict';
var chalk = require('chalk');
var crypto = require('crypto');
var _ = require('lodash');
var utils = require('keystone-utils');
var yeoman = require('yeoman-generator');

var KeystoneGenerator = yeoman.generators.Base.extend({

  initializing: function() {
    this.pkg = require('../package.json');
  },

  prompting: function() {
    var done = this.async();

    this.log('\nWelcome to the ' + chalk.green('Keystone React') + ' generator!\n');

    var prompts = [{
      type: 'input',
      name: 'projectName',
      message: 'What is the name of your project?',
      default: 'My Site'
    }, {
      type: 'confirm',
      name: 'createDirectory',
      message: 'Would you like to create a new directory for your project?',
      default: true
    }];

    this.prompt(prompts, function(props) {
      this.log('\n');
      _.extend(this, props);
      this.projectKey = utils.slug(this.projectName);
      if (props.createDirectory) {
        this.destinationRoot(this.projectKey);
      }
      done();
    }.bind(this));
  },

  keys: function keys() {
    this.cookieSecret = crypto.randomBytes(64).toString('hex');
  },

  writing: {
    project: function() {
      this.copy('keystone.js', 'keystone.js');
      this.copy('editorconfig', '.editorconfig');
      this.copy('gitignore', '.gitignore');
      this.copy('jshintrc', '.jshintrc');
      this.copy('Procfile', 'Procfile');
      this.template('_package.json', 'package.json');
    },

    clientfiles: function() {
      this.copy('client/scripts/application.js', 'client/scripts/application.js');
    },

    modelfiles: function() {
      this.copy('models/User.js', 'models/User.js');
    },

    publicfiles: function() {
      this.copy('public/favicon.ico', 'public/favicon.ico');
      this.directory('public/styles', 'public/styles');
    },

    routesfiles: function() {
      this.directory('routes/api', 'routes/api');
      this.copy('routes/index.js', 'routes/index.js');
    },

    templatefiles: function() {
      this.copy('templates/views/index.jade', 'templates/views/index.jade');
    },

    updatefiles: function() {
      this.copy('updates/0.0.1-admins.js', 'updates/0.0.1-admins.js');
    }

  },

  install: function() {
    this.log('\n' + chalk.green('Running npm install...') +
    '\n'
    );
    this.npmInstall();
  },

  end: function() {
    var cmd = (this.createDirectory ? '"cd ' + utils.slug(this.projectName) + '" then ' : '') + '"node keystone"';
    this.log(
      '\n' + chalk.green.underline('Your new project is ready!') +
      '\n' +
      '\n\nTo start Keystone, run ' + cmd + '.' +
      '\n'
    );
  }
});

module.exports = KeystoneGenerator;
<commit_msg>These spaces should be tabs<commit_after>'use strict';
var chalk = require('chalk');
var crypto = require('crypto');
var _ = require('lodash');
var utils = require('keystone-utils');
var yeoman = require('yeoman-generator');

var KeystoneGenerator = yeoman.generators.Base.extend({

	initializing: function() {
		this.pkg = require('../package.json');
	},

	prompting: function() {
		var done = this.async();

		this.log('\nWelcome to the ' + chalk.green('Keystone React') + ' generator!\n');

		var prompts = [{
			type: 'input',
			name: 'projectName',
			message: 'What is the name of your project?',
			default: 'My Site'
		}, {
			type: 'confirm',
			name: 'createDirectory',
			message: 'Would you like to create a new directory for your project?',
			default: true
		}];

		this.prompt(prompts, function(props) {
			this.log('\n');
			_.extend(this, props);
			this.projectKey = utils.slug(this.projectName);
			if (props.createDirectory) {
				this.destinationRoot(this.projectKey);
			}
			done();
		}.bind(this));
	},

	keys: function keys() {
		this.cookieSecret = crypto.randomBytes(64).toString('hex');
	},

	writing: {
		project: function() {
			this.copy('keystone.js', 'keystone.js');
			this.copy('editorconfig', '.editorconfig');
			this.copy('gitignore', '.gitignore');
			this.copy('jshintrc', '.jshintrc');
			this.copy('Procfile', 'Procfile');
			this.template('_package.json', 'package.json');
		},

		clientfiles: function() {
			this.copy('client/scripts/application.js', 'client/scripts/application.js');
		},

		modelfiles: function() {
			this.copy('models/User.js', 'models/User.js');
		},

		publicfiles: function() {
			this.copy('public/favicon.ico', 'public/favicon.ico');
			this.directory('public/styles', 'public/styles');
		},

		routesfiles: function() {
			this.directory('routes/api', 'routes/api');
			this.copy('routes/index.js', 'routes/index.js');
		},

		templatefiles: function() {
			this.copy('templates/views/index.jade', 'templates/views/index.jade');
		},

		updatefiles: function() {
			this.copy('updates/0.0.1-admins.js', 'updates/0.0.1-admins.js');
		}

	},

	install: function() {
		this.log('\n' + chalk.green('Running npm install...') +
		'\n'
		);
		this.npmInstall();
	},

	end: function() {
		var cmd = (this.createDirectory ? '"cd ' + utils.slug(this.projectName) + '" then ' : '') + '"node keystone"';
		this.log(
			'\n' + chalk.green.underline('Your new project is ready!') +
			'\n' +
			'\n\nTo start Keystone, run ' + cmd + '.' +
			'\n'
		);
	}
});

module.exports = KeystoneGenerator;

{'fraction_non_alphanumeric': 0.19248291571753987, 'fraction_numerical': 0.0030372057706909645, 'mean_word_length': 3.2253408179631116, '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': '5950708', 'n_tokens_mistral': 1897, 'n_tokens_neox': 1744, 'n_words': 330}