lib/main.js
function() {
        return new Promise(function(resolve, reject) {
            try {
                let files;
                if(fileUtils.fileExists(resourceDir)) {
                    files = fs.readdirSync(resourceDir);
                    files = _.uniqBy(files, function (f) {
                        return path.basename(f, '.' + rc.tools.spec.file_ext);
                    }).map(function(f) { return path.join(resourceDir, f);});
                }
                if(!files) files = [];
                resolve(files);
            } catch (err) {
                reject(err);
            }
        }).then(function(files) {
            return promiseUtils.chain(rc.tools.inspect, function(err) {
                console.error(err);
                return false;
            })(files);
        });
    }
function() {
        return new Promise(function(resolve, reject) {
            try {
                let files;
                if(fileUtils.fileExists(resourceDir)) {
                    files = fs.readdirSync(resourceDir);
                    files = _.uniqBy(files, function (f) {
                        return path.basename(f, '.' + rc.tools.spec.file_ext);
                    }).map(function(f) { return path.join(resourceDir, f);});
                }
                if(!files) files = [];
                resolve(files);
            } catch (err) {
                reject(err);
            }
        }).then(function(files) {
            return promiseUtils.chain(rc.tools.inspect, function(err) {
                console.error(err);
                return false;
            })(files);
        });
    }
function ( ) { return new Promise ( function ( resolve , reject ) { try { let files ; if ( fileUtils . fileExists ( resourceDir ) ) { files = fs . readdirSync ( resourceDir ) ; files = _ . uniqBy ( files , function ( f ) { return path . basename ( f , '.' + rc . tools . spec . file_ext ) ; } ) . map ( function ( f ) { return path . join ( resourceDir , f ) ; } ) ; } if ( ! files ) files = [ ] ; resolve ( files ) ; } catch ( err ) { reject ( err ) ; } } ) . then ( function ( files ) { return promiseUtils . chain ( rc . tools . inspect , function ( err ) { console . error ( err ) ; return false ; } ) ( files ) ; } ) ; }
Returns a list of resource containers that have been downloaded
@returns {Promise.<[{}]>} an array of resource container info objects (package.json).
Returns a list of resource containers that have been downloaded