Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/seeder.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,15 @@ function getSeedsAtLocation(location) {
* Locates seeds given a set of files to scrape
* @param {string[]} sources The filenames to scrape for seeds
*/
function locateSeeds(sources, cwd) {
function locateSeeds(sources) {
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) => {
return BbPromise.map(sources, (source) => {
return fileExists(source).then((exists) => {
if(!exists) {
throw new Error("source file " + location + " does not exist");
throw new Error("source file " + source + " does not exist");
}
return getSeedsAtLocation(location);
return getSeedsAtLocation(source);
});
// Smash the arrays together
}).then((seedArrays) => [].concat.apply([], seedArrays));
Expand Down