<commit_before>'use strict';

var fs = require('fs');
var fse = require('fs-extra');
var node_path = require('path');
var file = node_path.join(__dirname, 'dist', 'neuron.js');
var version = require('./package.json').cortex.version;

exports.content = function (callback) {
  fs.readFile(file, callback);
};


exports.version = function () {
  return version;
};


exports.write = function (dist, callback) {
  dist = node_path.join(dist, 'neuron', version, 'neuron.js');
  fse.copy(file, dist, callback);
};<commit_msg>neuron.write will check the existence of dest folder<commit_after>'use strict';

var fs = require('fs');
var fse = require('fs-extra');
var node_path = require('path');
var file = node_path.join(__dirname, 'dist', 'neuron.js');
var version = require('./package.json').cortex.version;

exports.content = function (callback) {
  fs.readFile(file, callback);
};


exports.version = function () {
  return version;
};


exports.write = function (dist, callback, force) {
  dist = node_path.join(dist, 'neuron', version, 'neuron.js');
  fs.exists(dist, function (exists) {
    if (!exists) {
      return fse.copy(file, dist, callback);
    }

    if (!force) {
      return callback(null);
    }

    fse.remove(dist, function (err) {
      if (err) {
        return callback(err);
      }

      fse.copy(file, dist, callback);
    });
  });
};
{'fraction_non_alphanumeric': 0.1734019103600294, 'fraction_numerical': 0.0, 'mean_word_length': 3.8992805755395685, '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': '4677652', 'n_tokens_mistral': 451, 'n_tokens_neox': 441, 'n_words': 108}