<commit_before>const fs = require('fs-extra');
const path = require('path');
const EasyZip = require('easy-zip').EasyZip;
const zip = new EasyZip();

function update(from, to){
	return new Promise((resolve, reject)=>{
		fs.remove(to)
		.then(()=>{
			fs.copy(from, to)
			.then(()=>{
				resolve();
			});
		});
	});
}

async function updateAll(cb){
	await update(path.join(__dirname, 'img'), path.join(__dirname, 'release', 'www', 'img'));
	await update(path.join(__dirname, 'dist'), path.join(__dirname, 'release', 'www', 'dist'));
	await update(path.join(__dirname, 'index.html'), path.join(__dirname, 'release', 'www', 'index.html'));
	cb();
}

fs.ensureDir(path.join(__dirname, 'release', 'www'))
.then(()=>{
	updateAll(()=>{
		zip.zipFolder(path.join(__dirname, 'release'), ()=>{
			zip.writeToFile(path.join(__dirname, 'release.zip'), ()=>{
				console.log('Release concluído!');
			});
		});
	});
});
<commit_msg>Adaptando release.js para versões mais antigas do Node<commit_after>const fs = require('fs-extra');
const path = require('path');
const EasyZip = require('easy-zip').EasyZip;
const zip = new EasyZip();

function update(from, to, cb){
	fs.remove(to)
	.then(()=>{
		fs.copy(from, to)
		.then(()=>{
			cb();
		});
	});
}

function updateAll(cb){
	update(path.join(__dirname, 'img'), path.join(__dirname, 'release', 'www', 'img'), ()=>{
		update(path.join(__dirname, 'dist'), path.join(__dirname, 'release', 'www', 'dist'), ()=>{
			update(path.join(__dirname, 'index.html'), path.join(__dirname, 'release', 'www', 'index.html'), ()=>{
				cb();
			});
		});
	});
}

fs.ensureDir(path.join(__dirname, 'release', 'www'))
.then(()=>{
	updateAll(()=>{
		zip.zipFolder(path.join(__dirname, 'release'), ()=>{
			zip.writeToFile(path.join(__dirname, 'release.zip'), ()=>{
				console.log('Release concluído!');
			});
		});
	});
});

{'fraction_non_alphanumeric': 0.24674620390455532, 'fraction_numerical': 0.0, 'mean_word_length': 5.15, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '2515179', 'n_tokens_mistral': 708, 'n_tokens_neox': 657, 'n_words': 124}