data/import.js
/**
 * Walks the app input directory, and inserts all the bundles into the database
 * @returns {Promise<*>}
 */
Walks the app input directory, and inserts all the bundles into the database
@returns {Promise<*>}
Walks the app input directory and inserts all the bundles into the database @returns { Promise< * > }
function insertBundles()
{
    let i = 0;
    return loopFiles((path, fileStats, next) => {
        Lib.readJSON(path).then(json => {
            i++;
            if (json.resourceType == "Bundle") {
                return insertBundle(json, fileStats.name, i);
            }
            else {
                console.log(`===> Skipping file "${fileStats.name}" (not a bundle)`.red);
            }
        }).then(next, console.error);
    });
}
function insertBundles ( ) { let i = 0 ; return loopFiles ( ( path , fileStats , next ) => { Lib . readJSON ( path ) . then ( json => { i ++ ; if ( json . resourceType == "Bundle" ) { return insertBundle ( json , fileStats . name , i ) ; } else { console . log ( ` ${ fileStats . name } ` . red ) ; } } ) . then ( next , console . error ) ; } ) ; }
Walks the app input directory, and inserts all the bundles into the database
 @returns {Promise<*>}
Walks the app input directory and inserts all the bundles into the database @returns { Promise< * > }