Skip to content

Fixed error thrown when no files to merge were found.#69

Open
zagushka wants to merge 1 commit intotettusud:masterfrom
zagushka:master
Open

Fixed error thrown when no files to merge were found.#69
zagushka wants to merge 1 commit intotettusud:masterfrom
zagushka:master

Conversation

@zagushka
Copy link

@zagushka zagushka commented Feb 24, 2021

Fixed error thrown when no files to merge were found.
I been stuck with such error when created groupBy rule with a pattern having no matching files.
Now instead of throwing

(node:67426) UnhandledPromiseRejectionWarning: TypeError: Reduce of empty array with no initial value
at Array.reduce ()

It will create a blank output file, with empty json {}
In general, just added initial value to .reduce

@tech-meppem
Copy link

Just to say we also encountered this problem. When no files are found, it throws an error (same one as above).

Maybe an option for "when no files found" could be passed in, to default to that when nothing is found? Instead of erroring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants