src/seeder.js
function locateSeeds(sources, cwd) {
  sources = sources || [];
  cwd = cwd || process.cwd();

  const locations = sources.map((source) => path.join(cwd, source));
  return BbPromise.map(locations, (location) => {
    return fileExists(location).then((exists) => {
      if(!exists) {
        throw new Error("source file " + location + " does not exist");
      }
      return getSeedsAtLocation(location);
    });
  // Smash the arrays together
  }).then((seedArrays) => [].concat.apply([], seedArrays));
}
function locateSeeds(sources, cwd) {
  sources = sources || [];
  cwd = cwd || process.cwd();

  const locations = sources.map((source) => path.join(cwd, source));
  return BbPromise.map(locations, (location) => {
    return fileExists(location).then((exists) => {
      if(!exists) {
        throw new Error("source file " + location + " does not exist");
      }
      return getSeedsAtLocation(location);
    });
  // Smash the arrays together
  }).then((seedArrays) => [].concat.apply([], seedArrays));
}
function locateSeeds ( sources , cwd ) { sources = sources || [ ] ; cwd = cwd || process . cwd ( ) ; const locations = sources . map ( ( source ) => path . join ( cwd , source ) ) ; return BbPromise . map ( locations , ( location ) => { return fileExists ( location ) . then ( ( exists ) => { if ( ! exists ) { throw new Error ( "source file " + location + " does not exist" ) ; } return getSeedsAtLocation ( location ) ; } ) ; // Smash the arrays together } ) . then ( ( seedArrays ) => [ ] . concat . apply ( [ ] , seedArrays ) ) ; }
Locates seeds given a set of files to scrape
@param {string[]} sources The filenames to scrape for seeds
Locates seeds given a set of files to scrape