<commit_before>var gulp = require('gulp'),
    install = require('gulp-install'),
    conflict = require('gulp-conflict'),
    template = require('gulp-template'),
    rename = require('gulp-rename'),
    _ = require('underscore.string'),
    path = require('path'),
    chalk = require('chalk-log');

module.exports = function(answers, targetDir) {
  answers.tagNameSlug = _.slugify(answers.tagName);
  if (!answers.tagNameSlug.match(/-/)) {
    chalk.error('Tag name must be of the form  xx-yyy, was:' + answers.tagNameSlug);
    return done();
  }
  answers.tagNameSlug = _.slugify(answers.tagName);
  var dest = path.join(targetDir, 'components', answers.tagNameSlug);

  answers.tagNamePretty = _.humanize(answers.tagName);
  gulp.src(__dirname + '/templates/**')
      .pipe(template(answers))
      .pipe(rename(function (file) {
          if (file.basename[0] === '_') {
              file.basename = '.' + file.basename.slice(1);
          }
      }))
      .pipe(conflict('./'))
      .pipe(gulp.dest(dest))
      .pipe(install())
      .on('end', function () {
          done();
      });
}<commit_msg>support sub- taglibs<commit_after>var gulp = require('gulp'),
    install = require('gulp-install'),
    conflict = require('gulp-conflict'),
    template = require('gulp-template'),
    rename = require('gulp-rename'),
    _ = require('underscore.string'),
    path = require('path'),
    chalk = require('chalk-log');

module.exports = function(answers, targetDir) {
  var compFileName = answers.tagName;
  var subFoldersPath = '';
  var subFolders = [];

  //sub folder
  var splits = compFileName.split(':');
  if (splits.length > 0) {
    var last = splits.length -1;
    compFileName = splits.slice(last);
    subFolders = splits.slice(0, last);
    subFoldersPath = subFolders.join('/');
  }

  answers.tagNameSlug = _.slugify(compFileName);
  if (!answers.tagNameSlug.match(/-/)) {
      if (subFoldersPath.length) {
        answers.tagNameSlug = [subFolders[subFolders.length -1], answers.tagNameSlug].join('-');
      } else {
        chalk.error('Tag name must be of the form  xx-yyy, was:' + answers.tagNameSlug);
        return done();
      }
  }
  var dest = path.join(targetDir, 'components', subFoldersPath, answers.tagNameSlug);
  answers.tagNamePretty = _.humanize(answers.tagName);
  gulp.src(__dirname + '/templates/**')
      .pipe(template(answers))
      .pipe(rename(function (file) {
          if (file.basename[0] === '_') {
              file.basename = '.' + file.basename.slice(1);
          }
      }))
      .pipe(conflict('./'))
      .pipe(gulp.dest(dest))
      .pipe(install())
      .on('end', function () {
          done();
      });
}
{'fraction_non_alphanumeric': 0.17566058801637513, 'fraction_numerical': 0.00297729810197246, 'mean_word_length': 2.9183673469387754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1953961', 'n_tokens_mistral': 917, 'n_tokens_neox': 901, 'n_words': 152}