isaacs / node-graceful-fs

fs with incremental backoff on EMFILE
ISC License
1.27k stars 148 forks source link

fix: copyFile with flags #202

Closed FeelyChau closed 3 years ago

FeelyChau commented 3 years ago

If we call fs.copyFile with flags, the parameter callback misses:

const fs = require('fs-extra'); // `fs.copyFile` called grancful-fs.copyFile

async function copy(src, dest) {
   console.log('start');
  await fs.copyFile(src, dest, fs.constants.COPYFILE_FICLONE);
  console.log('end'); // never get this line
}

copy(__filename, './another-file.js');
FeelyChau commented 3 years ago

Does the unit tests work now?

GiladShoham commented 3 years ago

If you can make a new release once this merged, it will be really great. This fixes a serious regression. Thanks a lot