<commit_before>'use strict';

var utils = require('./utils');
var files = require('../files.json');

/* Process files */
module.exports = function () {
  var _ = this._;
  var data = this;

  function process(content) {
    return _.template(content.toString().replace(/\n<%/g, '<%'), data);
  }

  var copy = function copy(src, dest, processing) {
    dest = utils.replacePrefix(dest, this.props.paths);
    try {
      if(processing) {
        this.fs.copy(this.templatePath(src), this.destinationPath(dest), { process: process });
      } else {
        this.fs.copy(this.templatePath(src), this.destinationPath(dest));
      }
    } catch (error) {
      console.error('Template processing error on file', src);
      throw error;
    }
  }.bind(this);

  // Copy dot files
  _.forEach(files.dotFiles, function(src) {
    copy(src, '.' + src);
  });

  // Copy files formatted (format.js) with options selected in prompt
  _.forEach(this.staticFiles, function(dest, src) {
    copy(src, dest);
  });<commit_msg>Don't drop newline when template starts with <%= or <%-<commit_after>'use strict';

var utils = require('./utils');
var files = require('../files.json');

/* Process files */
module.exports = function () {
  var _ = this._;
  var data = this;

  function process(content) {
    return _.template(content.toString().replace(/\n<%![-=]]/g, '<%'), data);
  }

  var copy = function copy(src, dest, processing) {
    dest = utils.replacePrefix(dest, this.props.paths);
    try {
      if(processing) {
        this.fs.copy(this.templatePath(src), this.destinationPath(dest), { process: process });
      } else {
        this.fs.copy(this.templatePath(src), this.destinationPath(dest));
      }
    } catch (error) {
      console.error('Template processing error on file', src);
      throw error;
    }
  }.bind(this);

  // Copy dot files
  _.forEach(files.dotFiles, function(src) {
    copy(src, '.' + src);
  });

  // Copy files formatted (format.js) with options selected in prompt
  _.forEach(this.staticFiles, function(dest, src) {
    copy(src, dest);
  });
{'fraction_non_alphanumeric': 0.16987487969201154, 'fraction_numerical': 0.0, 'mean_word_length': 3.09251968503937, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1304913', 'n_tokens_mistral': 655, 'n_tokens_neox': 640, 'n_words': 152}