<commit_before>var gulp = require('gulp');
var path = require('path');
var chalk = require('chalk');
var S = require('string');
var fs = require('fs-extra');

var config = fs.readJsonSync('conf/config.json');
var liferayHome = config.liferayHome;
var bundleHome = config.bundleHome;

var docrootHome = path.join(liferayHome, 'portal-web', 'docroot');
var rootHome = path.join(bundleHome, 'tomcat-7.0.42', 'webapps', 'ROOT');

function startGulpWatch(src, dest) {
	console.log(chalk.bgBlack.gray('Listening for changes to') + chalk.bgBlack(' \"docroot\".'));

	gulp.watch(path.join(src,'**/*.*'), function(event) {
		var filePath = path.dirname(event.path).replace(src, dest);

		gulp.src(event.path)
			.pipe(gulp.dest(filePath));

		console.log(chalk.green('Updated file: '), event.path.replace(src, dest));
	});
}

if (!liferayHome.length || !bundleHome.length) {
	console.log(chalk.red('Please run \"npm run config\" to configure your source and bundle paths'));
}
else if (fs.existsSync(docrootHome) && fs.existsSync(rootHome)) {
	startGulpWatch(docrootHome, rootHome);<commit_msg>Add time to logging and truncate filepath<commit_after>var gulp = require('gulp');
var path = require('path');
var chalk = require('chalk');
var S = require('string');
var fs = require('fs-extra');

var config = fs.readJsonSync('conf/config.json');
var liferayHome = config.liferayHome;
var bundleHome = config.bundleHome;

var docrootHome = path.join(liferayHome, 'portal-web', 'docroot');
var rootHome = path.join(bundleHome, 'tomcat-7.0.42', 'webapps', 'ROOT');

function startGulpWatch(src, dest) {
	console.log(chalk.bgBlack.gray('Listening for changes to') + chalk.bgBlack(' \"docroot\".\n'));

	gulp.watch(path.join(src,'**/*.*'), function(event) {
		var filePath = path.dirname(event.path).replace(src, dest);

		gulp.src(event.path)
			.pipe(gulp.dest(filePath));

		var date = new Date();
		var time = [
			date.getHours(),
			date.getMinutes(),
			date.getSeconds(),
		].join(':');

		console.log(chalk.yellow(time) + ' - ' +  chalk.green('Updated file: ') + event.path.replace(src, ''));
	});
}

if (!liferayHome.length || !bundleHome.length) {
	console.log(chalk.red('Please run \"npm run config\" to configure your source and bundle paths'));
}
else if (fs.existsSync(docrootHome) && fs.existsSync(rootHome)) {
	startGulpWatch(docrootHome, rootHome);
{'fraction_non_alphanumeric': 0.18603661132396765, 'fraction_numerical': 0.0034057045551298426, 'mean_word_length': 5.3002680965147455, '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': '2520629', 'n_tokens_mistral': 835, 'n_tokens_neox': 813, 'n_words': 169}