Skip to content

Commit

Permalink
fix(public/fs): correctly identifies skipped copies for !options.over…
Browse files Browse the repository at this point in the history
…write and destination is an exi
  • Loading branch information
rafamel committed May 22, 2019
1 parent 48164c7 commit 7da1874
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/public/fs/copy/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export async function each(
};

const srcExist = await exists(src, { fail: options.fail });
if (!srcExist) {
const skip =
!srcExist ||
(!options.overwrite &&
(await exists(dest)) &&
(await fs.stat(dest).then((stat) => !stat.isDirectory())));
if (skip) {
log(options, 'info')(
`Copy skipped: "${relatives.src}" to "${relatives.dest}"`
);
Expand Down

0 comments on commit 7da1874

Please sign in to comment.