<commit_before>#!/usr/bin/env node
;(function(paths) {

	var argv = require("yargs").argv;
	var fs = require("fs");
	var p = require("path");
	var io = require("../utils/io");
	var _ = require("lodash");
	var path = argv.p;
	var out = argv.o || p.join(process.cwd(), "build/bundle.sql");
	var TAG = "Script created by #ornito-sql-organizer on ";
	var COMMENT = "--";
	
	if(!path){
		console.log("Ornito helper => *Be sure the scripts and the maps.json have the same name. Usage: node index.js --p path/to/your/scripts/ [--o path/to/output/filename.sql]");
		return;
	}

  	var files = io.listAllFiles(path);

  	organize(identifyMaps(files), function(buffer){
		var content = _.union(buffer, files)
					.map(function(file){
						return io.readFile(file);
					});

		tag(content);

		io.write(out
			, content.join("\n\n")
			, {enconding: "utf-8"}
			, function(){
				console.log('Bundle created on:', out);
			});
	});<commit_msg>Fix encoding<commit_after>#!/usr/bin/env node
;(function(paths) {

	var argv = require("yargs").argv;
	var fs = require("fs");
	var p = require("path");
	var io = require("../utils/io");
	var _ = require("lodash");
	var path = argv.p;
	var out = argv.o || p.join(process.cwd(), "build/bundle.sql");
	var TAG = "Script created by #ornito-sql-organizer on ";
	var COMMENT = "--";
	
	if(!path){
		console.log("Ornito helper => *Be sure the scripts and the maps.json have the same name. Usage: node index.js --p path/to/your/scripts/ [--o path/to/output/filename.sql]");
		return;
	}

  	var files = io.listAllFiles(path);

  	organize(identifyMaps(files), function(buffer){
		var content = _.union(buffer, files)
					.map(function(file){
						return io.readFile(file);
					});

		tag(content);

		io.write(out
			, content.join("\n\n")
			, {encoding: "utf-8"}
			, function(){
				console.log('Bundle created on:', out);
			});
	});
{'fraction_non_alphanumeric': 0.19271948608137046, 'fraction_numerical': 0.0010706638115631692, 'mean_word_length': 3.387323943661972, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5779619', 'n_tokens_mistral': 744, 'n_tokens_neox': 663, 'n_words': 157}