Skip to content

Commit

Permalink
fix(save): make sure to recursively mkdir when saving resources
Browse files Browse the repository at this point in the history
  • Loading branch information
uladkasach committed Jul 25, 2021
1 parent 2dcf91f commit 929c6ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const saveResource = async ({
}) => {
// ensure directory is defined
const dir = `${targetDirPath}/${resourceSpecificDir[type]}`;
await mkdir(dir).catch((error) => {
await mkdir(dir, { recursive: true }).catch((error) => {
if (error.code !== 'EEXIST') throw error;
}); // mkdir and ignore if dir already exists

Expand Down

0 comments on commit 929c6ca

Please sign in to comment.