<commit_before>import {
	getUrl,
	testUrl,
	makeTemplate,
	listContents,
	findImages,
} from './functions';

const fs     = require('fs');
const url    = require('url');
const filter = require('array-promise-filter');

//helpful values
var cwd = process.cwd();
var host;
const check = (value)=>{
	console.log('Checking -> ',value);
	return fs.lstatSync(`${cwd}/Templates/${host}/${value}`).isDirectory();
};


getUrl()
	.then( url => testUrl(url))
	.then( url => makeTemplate(url))
	.then( result =>  {
		host = url.parse(result).hostname;
		return listContents(`${cwd}/Templates/${host}`);
	})
	.then( data => findImages(`${__dirname}/Templates/${host}`))
	.then( data => data.split('\n'))
	.then(data => {
		console.log(data);
		process.exit(0);
	})
	.catch( (err) => {
		console.log('Promise rejected');
		console.log(err);
		process.exit(1);
	});<commit_msg>Indenting some lines properly<commit_after>import {
	getUrl,
	testUrl,
	makeTemplate,
	listContents,
	findImages,
} from './functions';

const fs     = require('fs');
const url    = require('url');
const filter = require('array-promise-filter');

//helpful values
var cwd = process.cwd();
var host;
const check = (value)=>{
	console.log('Checking -> ',value);
	return fs.lstatSync(`${cwd}/Templates/${host}/${value}`).isDirectory();
};


getUrl()
	.then( url 		=> testUrl(url))
	.then( url 		=> makeTemplate(url))
	.then( result 	=>  {
		host = url.parse(result).hostname;
		return listContents(`${cwd}/Templates/${host}`);
	})
	.then( data 	=> findImages(`${__dirname}/Templates/${host}`))
	.then( data 	=> data.split('\n'))
	.then( data 	=> {
		console.log(data);
		process.exit(0);
	})
	.catch( (err) 	=> {
		console.log('Promise rejected');
		console.log(err);
		process.exit(1);
	});
{'fraction_non_alphanumeric': 0.21714285714285714, 'fraction_numerical': 0.002285714285714286, 'mean_word_length': 4.306060606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '5838527', 'n_tokens_mistral': 654, 'n_tokens_neox': 648, 'n_words': 122}