<commit_before>import rl from './input';

var child_process 	= require('child_process');
const vu 			= require('valid-url');
var progressBar 	= require('progress');

export const getUrl = () => {
	return new Promise((resolve,reject) => {
		rl.question('Enter the root url:- ', (url) =>{
			if(url.length > 0){
				rl.close();
				resolve(url);
			} else {
				rl.close();
				reject(url);
			}
		});
	});
};

export const testUrl = (link) => {
	return new Promise((resolve,reject) => {
		if(vu.isWebUri(link)){
			resolve(link);
		} else {
			reject(link);
		}
	});
};

/*export const makeTemplate = (link) => {
	return new Promise((resolve,reject) => {
		child_process.exec(`wget -r ${link} -P ./Templates/`,(err,stdout,stderr) => {
			if(err){
				reject(err);
			}
			else{
				console.log('Trying wget');
				console.log(stderr);
				resolve(stdout);
			}
		})
	});
};*/

export const makeTemplate = (link) => {
	return new Promise((resolve,reject) => {
		var cwd = process.cwd();
		var wget = child_process.spawn('wget',['-r',link,'-P',cwd+'/Templates']);
		
		var bar = new progressBar('downloading [:bar] :percent :etas',{
			total:20,
			complete:"*",
			incomplete:"^",
			width:20
		});

		wget.stdout.on('data',(data) => {
			console.log(data);
			//bar.tick()
		});

		wget.stderr.on('data', (data) => {
			console.log('Wget err',data.toString());
		});

		wget.on('close',(code)=> {
			console.log('Child process exited with',code);
			resolve(code);
		});

		wget.on('error', (err)=> {
			reject(err);
		});
});
}<commit_msg>adding non verbose function to wget<commit_after>import rl from './input';

var child_process 	= require('child_process');
const vu 			= require('valid-url');
var progressBar 	= require('progress');

export const getUrl = () => {
	return new Promise((resolve,reject) => {
		rl.question('Enter the root url:- ', (url) =>{
			if(url.length > 0){
				rl.close();
				resolve(url);
			} else {
				rl.close();
				reject(url);
			}
		});
	});
};

export const testUrl = (link) => {
	return new Promise((resolve,reject) => {
		if(vu.isWebUri(link)){
			resolve(link);
		} else {
			reject(link);
		}
	});
};

/*export const makeTemplate = (link) => {
	return new Promise((resolve,reject) => {
		child_process.exec(`wget -r ${link} -P ./Templates/`,(err,stdout,stderr) => {
			if(err){
				reject(err);
			}
			else{
				console.log('Trying wget');
				console.log(stderr);
				resolve(stdout);
			}
		})
	});
};*/

export const makeTemplate = (link) => {
	return new Promise((resolve,reject) => {
		var cwd = process.cwd();
		var wget = child_process.spawn('wget',['-r',link,'-P',cwd+'/Templates','-nv']);
		
		var bar = new progressBar('downloading [:bar] :percent :etas',{
			total:20,
			complete:"*",
			incomplete:"^",
			width:20
		});

		wget.stdout.on('data',(data) => {
			console.log('Wget Data',data);
		});

		wget.stderr.on('data', (data) => {
			console.log(data.toString());
		});

		wget.on('close',(code)=> {
			console.log('Child process exited with',code);
			resolve(code);
		});

		wget.on('error', (err)=> {
			reject(err);
		});
});
}
{'fraction_non_alphanumeric': 0.21902296991264963, 'fraction_numerical': 0.003235198964736331, 'mean_word_length': 3.4297994269340975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7076017', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1125, 'n_words': 206}