<commit_before>const path = require('path');
const Base = require('yeoman-generator').Base;
const glob = require('glob');

module.exports = class GeneratorBase extends Base {
  constructor() {
    super(...arguments);
  }

  _copyFile(src, dest) {
    this.fs.copy(
      this.templatePath(src),
      this.destinationPath(dest)
    );
  }

  _templateFile(src, dest, data) {
    this.fs.copyTpl(
      this.templatePath(src),
      this.destinationPath(dest),
      data
    );
  }

  _copyDirectory(src, dest) {
    this._prepareFiles(src, dest, (files) => {
      files.forEach((file) => {
        this.fs.copy(file.src, file.dest);
      });
    });
  }

  _templateDirectory(src, dest, data) {
    this._prepareFiles(src, dest, (files) => {
      files.forEach((file) => {
        this.fs.copyTpl(file.src, file.dest, data);
      });
    });
  }

  _prepareFiles(src, dest, cb) {
    const files = [];

    src = path.join(this.templatePath(src), '**/*');
    dest = this.destinationPath(dest);

    glob(src, (err, paths) => {
      if (err) {
        throw err;
      }

      paths.forEach((srcPath) => {
        let relative = path.relative(src, srcPath);
        let dirname = path.dirname(relative);<commit_msg>fix up path problem with template directories<commit_after>const path = require('path');
const Base = require('yeoman-generator').Base;
const glob = require('glob');

module.exports = class GeneratorBase extends Base {
  constructor() {
    super(...arguments);
  }

  _copyFile(src, dest) {
    this.fs.copy(
      this.templatePath(src),
      this.destinationPath(dest)
    );
  }

  _templateFile(src, dest, data) {
    this.fs.copyTpl(
      this.templatePath(src),
      this.destinationPath(dest),
      data
    );
  }

  _copyDirectory(src, dest) {
    this._prepareFiles(src, dest, (files) => {
      files.forEach((file) => {
        this.fs.copy(file.src, file.dest);
      });
    });
  }

  _templateDirectory(src, dest, data) {
    this._prepareFiles(src, dest, (files) => {
      files.forEach((file) => {
        this.fs.copyTpl(file.src, file.dest, data);
      });
    });
  }

  _prepareFiles(src, dest, cb) {
    const files = [];

    src = this.templatePath(src);
    dest = this.destinationPath(dest);

    glob(path.join(src, '**/*'), (err, paths) => {
      if (err) {
        throw err;
      }

      paths.forEach((srcPath) => {
        let relative = path.relative(src, srcPath);
        let dirname = path.dirname(relative);
{'fraction_non_alphanumeric': 0.16464891041162227, 'fraction_numerical': 0.0, 'mean_word_length': 2.60844250363901, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '3974410', 'n_tokens_mistral': 826, 'n_tokens_neox': 808, 'n_words': 145}