Skip to content

Commit 438296d

Browse files
committed
Adjust structure of file to faucet-pipeline-js
1 parent 6e0a4fa commit 438296d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ let FileFinder = require("faucet-pipeline-core/lib/util/files/finder");
55
let readFile = promisify(require("fs").readFile);
66
let stat = promisify(require("fs").stat);
77

8-
module.exports = (pluginConfig, assetManager, { compact }) => {
9-
let copiers = pluginConfig.map(copyConfig =>
10-
buildCopier(copyConfig, assetManager, { compact }));
8+
module.exports = (config, assetManager, { compact } = {}) => {
9+
let copiers = config.map(copyConfig =>
10+
makeCopier(copyConfig, assetManager, { compact }));
1111

12-
return files => Promise.all(copiers.map(copier => copier(files)));
12+
return filepaths => Promise.all(copiers.map(copy => copy(filepaths)));
1313
};
1414

15-
function buildCopier(copyConfig, assetManager, { compact }) {
15+
function makeCopier(copyConfig, assetManager, { compact } = {}) {
1616
let source = assetManager.resolvePath(copyConfig.source);
1717
let target = assetManager.resolvePath(copyConfig.target, {
1818
enforceRelative: true
@@ -24,9 +24,9 @@ function buildCopier(copyConfig, assetManager, { compact }) {
2424
let { fingerprint } = copyConfig;
2525
let plugins = determinePlugins(compact, copyConfig);
2626

27-
return files => {
27+
return filepaths => {
2828
return Promise.all([
29-
(files ? fileFinder.match(files) : fileFinder.all()),
29+
(filepaths ? fileFinder.match(filepaths) : fileFinder.all()),
3030
determineTargetDir(source, target)
3131
]).then(([fileNames, targetDir]) => {
3232
return processFiles(fileNames, {

0 commit comments

Comments
 (0)