lib/bootstrap.js
function bootrapSitesAndComponents() {
  const sites = siteService.sites(),
    sitesArray = _.map(Object.keys(sites), site => sites[site]);

  return highland(sitesArray)
    .flatMap(site => {
      return highland(
        bootstrapComponents(site)
          .then(function () {
            return site;
          })
          .catch(function () {
            log('debug', `Errors bootstrapping components for site: ${site.slug}`);
            return site;
          })
      );
    })
    .flatMap(site => {
      return highland(
        bootstrapPath(site.dir, site)
          .catch(function () {
            log('debug', `No bootstrap file found for site: ${site.slug}`);
            return site;
          })
      );
    })
    .collect()
    .toPromise(bluebird);
}
function bootrapSitesAndComponents() {
  const sites = siteService.sites(),
    sitesArray = _.map(Object.keys(sites), site => sites[site]);

  return highland(sitesArray)
    .flatMap(site => {
      return highland(
        bootstrapComponents(site)
          .then(function () {
            return site;
          })
          .catch(function () {
            log('debug', `Errors bootstrapping components for site: ${site.slug}`);
            return site;
          })
      );
    })
    .flatMap(site => {
      return highland(
        bootstrapPath(site.dir, site)
          .catch(function () {
            log('debug', `No bootstrap file found for site: ${site.slug}`);
            return site;
          })
      );
    })
    .collect()
    .toPromise(bluebird);
}
function bootrapSitesAndComponents ( ) { const sites = siteService . sites ( ) , sitesArray = _ . map ( Object . keys ( sites ) , site => sites [ site ] ) ; return highland ( sitesArray ) . flatMap ( site => { return highland ( bootstrapComponents ( site ) . then ( function ( ) { return site ; } ) . catch ( function ( ) { log ( 'debug' , ` ${ site . slug } ` ) ; return site ; } ) ) ; } ) . flatMap ( site => { return highland ( bootstrapPath ( site . dir , site ) . catch ( function ( ) { log ( 'debug' , ` ${ site . slug } ` ) ; return site ; } ) ) ; } ) . collect ( ) . toPromise ( bluebird ) ; }
Bootstrap all sites and the individual
bootstrap files in each component's directory

@return {Promise}
Bootstrap all sites and the individual bootstrap files in each component s directory