<commit_before>var glob = require('glob');
var fs = require('fs');

var ROOT = __dirname + '/../src/';

glob(ROOT + '**/*.glsl', function (err, files) {
    files.forEach(function (filePath) {
        var glslCode = fs.readFileSync(filePath, 'utf-8');
        
        //From THREE.js's rollup.config.js
        glslCode = glslCode
            .replace( /[ \t]*\/\/.*\n/g, '' ) // remove //
            .replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' ) // remove /* */
            .replace( /\n{2,}/g, '\n' ) // # \n+ to \n

        // var dir = path.dirname(filePath);
        // var baseName = path.basename(filePath, '.essl');
        fs.writeFileSync(
            filePath + '.js',
            'export default ' +
               JSON.stringify(glslCode) + ';\n',
            'utf-8'
        );
    });
});<commit_msg>remove \r of glsl in windows<commit_after>var glob = require('glob');
var fs = require('fs');

var ROOT = __dirname + '/../src/';

glob(ROOT + '**/*.glsl', function (err, files) {
    files.forEach(function (filePath) {
        var glslCode = fs.readFileSync(filePath, 'utf-8');
        
        //From THREE.js's rollup.config.js
        glslCode = glslCode
            .replace( /\r/g, '' ) // remove \r
            .replace( /[ \t]*\/\/.*\n/g, '' ) // remove //
            .replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' ) // remove /* */
            .replace( /\n{2,}/g, '\n' ) // # \n+ to \n

        // var dir = path.dirname(filePath);
        // var baseName = path.basename(filePath, '.essl');
        fs.writeFileSync(
            filePath + '.js',
            'export default ' +
               JSON.stringify(glslCode) + ';\n',
            'utf-8'
        );
    });
});
{'fraction_non_alphanumeric': 0.22334123222748814, 'fraction_numerical': 0.0035545023696682463, 'mean_word_length': 1.5475113122171946, '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': '4178091', 'n_tokens_mistral': 591, 'n_tokens_neox': 579, 'n_words': 115}