lib/file-filter.js
function filesInRepository(dir) {
        var ignoreDirs = cog.getOption('ignore_dirs');
        // TODO: Allow an array and move to config.
        var ignoreFiles = /~$/;
        var files = glob.sync(dir ? dir + '/*' : '*');
        var ret = [];
        for (var i = 0; i < files.length; i++) {
            if (fs.lstatSync(files[i]).isDirectory()) {
                // Ignore standard directories of uninterest.
                if (!dir && ignoreDirs.indexOf(files[i]) >= 0) {
                    continue;
                }
                ret = filesInRepository(files[i]).concat(ret);
            } else {
                if (!ignoreFiles.test(files[i])) {
                    ret.push(files[i]);
                }
            }
        }
        return ret;
    }
function filesInRepository(dir) {
        var ignoreDirs = cog.getOption('ignore_dirs');
        // TODO: Allow an array and move to config.
        var ignoreFiles = /~$/;
        var files = glob.sync(dir ? dir + '/*' : '*');
        var ret = [];
        for (var i = 0; i < files.length; i++) {
            if (fs.lstatSync(files[i]).isDirectory()) {
                // Ignore standard directories of uninterest.
                if (!dir && ignoreDirs.indexOf(files[i]) >= 0) {
                    continue;
                }
                ret = filesInRepository(files[i]).concat(ret);
            } else {
                if (!ignoreFiles.test(files[i])) {
                    ret.push(files[i]);
                }
            }
        }
        return ret;
    }
function filesInRepository ( dir ) { var ignoreDirs = cog . getOption ( 'ignore_dirs' ) ; // TODO: Allow an array and move to config. var ignoreFiles = / ~$ / ; var files = glob . sync ( dir ? dir + '/*' : '*' ) ; var ret = [ ] ; for ( var i = 0 ; i < files . length ; i ++ ) { if ( fs . lstatSync ( files [ i ] ) . isDirectory ( ) ) { // Ignore standard directories of uninterest. if ( ! dir && ignoreDirs . indexOf ( files [ i ] ) >= 0 ) { continue ; } ret = filesInRepository ( files [ i ] ) . concat ( ret ) ; } else { if ( ! ignoreFiles . test ( files [ i ] ) ) { ret . push ( files [ i ] ) ; } } } return ret ; }
Perform recursive lookup for files in the repository.

@return {Array} A list of files in the repository ignoring files of not interest.
Perform recursive lookup for files in the repository .