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

// Libs
var libsPath = path.join(__dirname + '/../' + '/libs/');
var cloneBones = require(libsPath + 'clone-bones');
var ascii = require(libsPath + 'ascii');

var WpBonesGenerator = module.exports = function (args, options) {
  yeoman.generators.Base.apply(this, arguments);

  // Need to override the default yeoman method in order to make
  // this works. If someone has a better idea, tell me. (@iam4x)
  this.directory = function (source, destination, process) {
    // Yeah just for this line, need to set the root as the source
    // or it will look inside the generator itself
    var root = source;
    var files = this.expandFiles('**', {dot: true, cwd: root});
    var self = this;

    destination = destination || source;

    if (typeof destination === 'function') {
      process = destination;
      destination = source;
    }

    // get the path relative to the template root, and copy to the relative destination
    var resolveFiles = function (filepath) {
      return function (next) {
        if (!filepath) {
          self.emit('directory:end');
          return next();
        }

        var dest = path.join(destination, filepath);
        self.copy(path.join(root, filepath), dest, process);

        return next();
      };
    };

    async.parallel(files.map(resolveFiles));
    return this;
  };

  this.on('end', function () {
    this.installDependencies({
      skipInstall: options['skip-install']
    });
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '/../', '/package.json')));
};
<commit_msg>Fixed installing dependencies<commit_after>'use strict';
var util = require('util');
var path = require('path');
var async = require('async');
var yeoman = require('yeoman-generator');

// Libs
var libsPath = path.join(__dirname + '/../' + '/libs/');
var cloneBones = require(libsPath + 'clone-bones');
var ascii = require(libsPath + 'ascii');

var WpBonesGenerator = module.exports = function (args, options) {
  yeoman.generators.Base.apply(this, arguments);

  // Need to override the default yeoman method in order to make
  // this works. If someone has a better idea, tell me. (@iam4x)
  this.directory = function (source, destination, process) {
    // Yeah just for this line, need to set the root as the source
    // or it will look inside the generator itself
    var root = source;
    var files = this.expandFiles('**', {dot: true, cwd: root});
    var self = this;

    destination = destination || source;

    if (typeof destination === 'function') {
      process = destination;
      destination = source;
    }

    // get the path relative to the template root, and copy to the relative destination
    var resolveFiles = function (filepath) {
      return function (next) {
        if (!filepath) {
          self.emit('directory:end');
          return next();
        }

        var dest = path.join(destination, filepath);
        self.copy(path.join(root, filepath), dest, process);

        return next();
      };
    };

    async.parallel(files.map(resolveFiles));
    return this;
  };

	this.on('end', function () {
		try {
			process.chdir(process.cwd() + '/' + this.themeNameSpace + '/library/grunt');
			this.installDependencies({
				skipInstall: options['skip-install'],
				callback: function () {
					this.spawnCommand('grunt', ['default']);
				}.bind(this)
			});

		} catch (err) {
			console.log('Failed to install dependencies: ' + err);
		}
	});

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

{'fraction_non_alphanumeric': 0.14559180372067942, 'fraction_numerical': 0.0005392289026691831, 'mean_word_length': 3.050218340611354, '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': '4839114', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1058, 'n_words': 326}