<commit_before>var fs = require('fs');
var childProcess = require('child_process');

var Promise = require('bluebird');

Promise.promisifyAll(childProcess);

module.exports = function updateRepository () {
	if (fs.existsSync(__dirname + '/../jsdelivr/')) {
		console.log('Updating the local repository.');
		return childProcess.execAsync('git pull', { cwd: __dirname + '/../jsdelivr/' });
	}

	console.log('Cloning the repository. This will take a while...');
	return childProcess.execAsync('git clone https://github.com/jsdelivr/jsdelivr.git', { cwd: __dirname + '/../' });
};<commit_msg>Show output from git when updating the repository<commit_after>var fs = require('fs');
var childProcess = require('child_process');

var Promise = require('bluebird');

module.exports = function updateRepository () {
	return new Promise(function (resolve, reject) {
		var child;

		if (fs.existsSync(__dirname + '/../jsdelivr/')) {
			console.log('Updating the local repository.');
			child = childProcess.spawn('git', [ 'pull' ], { cwd: __dirname + '/../jsdelivr/' });
		} else {
			console.log('Cloning the repository. This will take a while...');
			child = childProcess.spawn('git', [ 'clone', 'https://github.com/jsdelivr/jsdelivr.git' ], { cwd: __dirname + '/../' });
		}

		child.stdout.pipe(process.stdout);
		child.stderr.pipe(process.stderr);

		child.on('close', function (code) {
			code ? reject(code) : resolve();
		});
	});
};
{'fraction_non_alphanumeric': 0.18461538461538463, 'fraction_numerical': 0.0, 'mean_word_length': 4.319702602230484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5302246', 'n_tokens_mistral': 471, 'n_tokens_neox': 448, 'n_words': 102}