From 827668b5e45fcbd8f50024b4191c538c0f63cfdd Mon Sep 17 00:00:00 2001 From: Alexey Shamrin Date: Wed, 4 Mar 2020 11:17:25 +0200 Subject: [PATCH 1/2] allow absolute paths for seed sources --- src/seeder.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/seeder.js b/src/seeder.js index 348a6b5c..ae59f3f5 100644 --- a/src/seeder.js +++ b/src/seeder.js @@ -127,11 +127,9 @@ 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) { - sources = sources || []; - cwd = cwd || process.cwd(); +function locateSeeds(locations) { + locations = locations || []; - const locations = sources.map((source) => path.join(cwd, source)); return BbPromise.map(locations, (location) => { return fileExists(location).then((exists) => { if(!exists) { From f3727ccc52ea423be60c643eef7fded353e845d3 Mon Sep 17 00:00:00 2001 From: Alexey Shamrin Date: Wed, 4 Mar 2020 11:30:00 +0200 Subject: [PATCH 2/2] rename back to previous parameter name --- src/seeder.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/seeder.js b/src/seeder.js index ae59f3f5..071b060a 100644 --- a/src/seeder.js +++ b/src/seeder.js @@ -127,15 +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(locations) { - locations = locations || []; +function locateSeeds(sources) { + sources = sources || []; - 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));