<commit_before>var fs = require('fs');
var path = require('path');
var prompt = require('promptly').prompt;
var extend = require('xtend');
var _ = require('underscore');

function noop() {}

/**
 * Initialize a new `Template` with the given `name`.
 *
 * @param {String} name
 * @api private
 */

function Template(name, opts) {
    if (!(this instanceof Template)) {
        return new Template(name, opts);
    }

    this.templates = opts.templates;
    this.description = opts.description;
    this.name = name;
    this.logger = opts.logger || {
        log: noop
    };
    this.path = path.join(this.templates, name);
    this.contentPath = this.path + '/content';
    this.mod = require(this.path + '/index.js');
    this.values = extend(opts, {
        year: new Date().getFullYear()
    });
    this.updateJSON = opts['update-json'];
    this.directories = {};
    //TODO make this a bit less janky
    try {
        this.exclusions = require(this.path + '/exclude.js')(this.values);
    } catch(e) {
        if (e.code !== 'MODULE_NOT_FOUND') { throw e; }
        this.exclusions = [];
    }
}

/**
 * Initialize template at `dest`.
 *
 * @param {String} dest
 * @api private
 */

Template.prototype.init = function(dest, callback) {
    var self = this;
    var vars = self.mod;
    var keys = Object.keys(vars);

    self.values.project = dest;
    self.dest = dest;
    // print new line for pretties.
    self.logger.log();

    function parseLocal() {<commit_msg>dest path doesn't become package.json:name<commit_after>var fs = require('fs');
var path = require('path');
var prompt = require('promptly').prompt;
var extend = require('xtend');
var _ = require('underscore');

function noop() {}

/**
 * Initialize a new `Template` with the given `name`.
 *
 * @param {String} name
 * @api private
 */

function Template(name, opts) {
    if (!(this instanceof Template)) {
        return new Template(name, opts);
    }

    this.templates = opts.templates;
    this.description = opts.description;
    this.name = name;
    this.logger = opts.logger || {
        log: noop
    };
    this.path = path.join(this.templates, name);
    this.contentPath = this.path + '/content';
    this.mod = require(this.path + '/index.js');
    this.values = extend(opts, {
        year: new Date().getFullYear()
    });
    this.updateJSON = opts['update-json'];
    this.directories = {};
    //TODO make this a bit less janky
    try {
        this.exclusions = require(this.path + '/exclude.js')(this.values);
    } catch(e) {
        if (e.code !== 'MODULE_NOT_FOUND') { throw e; }
        this.exclusions = [];
    }
}

/**
 * Initialize template at `dest`.
 *
 * @param {String} dest
 * @api private
 */

Template.prototype.init = function(dest, callback) {
    var self = this;
    var vars = self.mod;
    var keys = Object.keys(vars);

    self.values.project = path.basename(dest);
    self.dest = dest;
    // print new line for pretties.
    self.logger.log();

    function parseLocal() {
{'fraction_non_alphanumeric': 0.15856095936042638, 'fraction_numerical': 0.0, 'mean_word_length': 2.73972602739726, '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': '150482', 'n_tokens_mistral': 958, 'n_tokens_neox': 938, 'n_words': 240}