tasks/font_loader.js
function getFilesList(pattern) {
		//If pattern empty return all avaliable fonts
		if (pattern === undefined || pattern === '') {
			formatingFontsArray(serverFonts);
			closeConnection();
			return; // We are completed, close connection and end the program
		}

		var serverFiles = [],
			preg = new RegExp('[\\w\\-\\.]*' + pattern + '[\\w\\-\\.]*');


		function regular() {
			if (serverFonts.length < 1) {
				if (serverFiles.length !== 0){
					formatingFontsArray(serverFiles);
				}else{
					grunt.log.warn('We haven\'t any suitable fonts');
				}
				closeConnection();
				return; // We are completed, close connection and end the program
			}
			var file = serverFonts.pop();
			if (preg.test(file)) {
				serverFiles.push(file);
			}
			regular();
		}
		regular();
	}
function getFilesList(pattern) {
		//If pattern empty return all avaliable fonts
		if (pattern === undefined || pattern === '') {
			formatingFontsArray(serverFonts);
			closeConnection();
			return; // We are completed, close connection and end the program
		}

		var serverFiles = [],
			preg = new RegExp('[\\w\\-\\.]*' + pattern + '[\\w\\-\\.]*');


		function regular() {
			if (serverFonts.length < 1) {
				if (serverFiles.length !== 0){
					formatingFontsArray(serverFiles);
				}else{
					grunt.log.warn('We haven\'t any suitable fonts');
				}
				closeConnection();
				return; // We are completed, close connection and end the program
			}
			var file = serverFonts.pop();
			if (preg.test(file)) {
				serverFiles.push(file);
			}
			regular();
		}
		regular();
	}
function getFilesList ( pattern ) { //If pattern empty return all avaliable fonts if ( pattern === undefined || pattern === '' ) { formatingFontsArray ( serverFonts ) ; closeConnection ( ) ; return ; // We are completed, close connection and end the program } var serverFiles = [ ] , preg = new RegExp ( '[\\w\\-\\.]*' + pattern + '[\\w\\-\\.]*' ) ; function regular ( ) { if ( serverFonts . length < 1 ) { if ( serverFiles . length !== 0 ) { formatingFontsArray ( serverFiles ) ; } else { grunt . log . warn ( 'We haven\'t any suitable fonts' ) ; } closeConnection ( ) ; return ; // We are completed, close connection and end the program } var file = serverFonts . pop ( ) ; if ( preg . test ( file ) ) { serverFiles . push ( file ) ; } regular ( ) ; } regular ( ) ; }
Get list from server
@param  {String} pattern pattern for search
Get list from server