<commit_before>var packageFile = require('./package.json'),
    fs = require('fs'),
    _ = require('underscore'),
    ejs = require('ejs');

var versionFile = module.exports = function(configObject){
    var currentTime = (new Date()),
        name = packageFile.name,
        version = packageFile.version,
        fileContent;

    var defaultConfig = {
        pathToOutputFile: './version.txt',
        pathToTemplate: 'version.ejs',
        templateString: '',
        extras: {}
    };


    /**
     * Renders the template and writes the version file to the file system.
     * @param templateContent
     */
    var writeFile = function(templateContent){
        fileContent = ejs.render(templateContent, {'name': name, 'version': version, 'time': currentTime, extras: configObject.extras});
        fs.writeFileSync(configObject.pathToOutputFile, fileContent, {flag: 'w'});
    }
    
    //set default config data
    configObject = configObject || {};
    configObject = _.defaults(configObject, defaultConfig);

    // If we are given a template string in the config, then use it directly.
    // But if we get a file path, fetch the content then use it.
    if(configObject.templateString){
        writeFile(configObject.templateString);
    }else{
        var content = fs.readFileSync(configObject.pathToTemplate, {encoding: 'utf8'});
            writeFile(content);
    }


};
<commit_msg>adjusting the path to the default version.txt file<commit_after>var packageFile = require('./package.json'),
    fs = require('fs'),
    _ = require('underscore'),
    ejs = require('ejs');

var versionFile = module.exports = function(configObject){
    var currentTime = (new Date()),
        name = packageFile.name,
        version = packageFile.version,
        fileContent;

    var defaultConfig = {
        pathToOutputFile: __dirname + '/version.txt',
        pathToTemplate: 'version.ejs',
        templateString: '',
        extras: {}
    };


    /**
     * Renders the template and writes the version file to the file system.
     * @param templateContent
     */
    var writeFile = function(templateContent){
        fileContent = ejs.render(templateContent, {'name': name, 'version': version, 'time': currentTime, extras: configObject.extras});
        fs.writeFileSync(configObject.pathToOutputFile, fileContent, {flag: 'w'});
    }
    
    //set default config data
    configObject = configObject || {};
    configObject = _.defaults(configObject, defaultConfig);

    // If we are given a template string in the config, then use it directly.
    // But if we get a file path, fetch the content then use it.
    if(configObject.templateString){
        writeFile(configObject.templateString);
    }else{
        var content = fs.readFileSync(configObject.pathToTemplate, {encoding: 'utf8'});
            writeFile(content);
    }


};

{'fraction_non_alphanumeric': 0.11914744933612859, 'fraction_numerical': 0.0006988120195667365, 'mean_word_length': 2.91120218579235, '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': '7495527', 'n_tokens_mistral': 790, 'n_tokens_neox': 775, 'n_words': 218}