Skip to content

Commit

Permalink
fix: Random ENOENT errors in copy_file_or_directory on Windows
Browse files Browse the repository at this point in the history
This happens for more or less the same files, usually on a batch update (eg. after typescript rebuilds a project and emits a lot of files). Looks like only `fs-extra` throws error, `fs` doesn't.

BTW, we don't need to use `pify` for `fse`, as `fs-extra` supports promises out of the box. But simply removing the `promisified.` prefix doesn't solve the issue.
  • Loading branch information
bencergazda committed Nov 29, 2021
1 parent be1f3bf commit e8674fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async function copy_file_or_directory(source_path, destination_path) {

// console.log('COPY', source_path, 'to', destination_path);

return promisified.fse.copy(source_path, destination_path);
return fs.promises.copyFile(source_path, destination_path);
}

/**
Expand Down

0 comments on commit e8674fa

Please sign in to comment.