Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

copyDirRecursive callback doesn't always receive error as the first parameter #47

Closed
ViciousPotato opened this issue Jan 24, 2013 · 1 comment

Comments

@ViciousPotato
Copy link
Contributor

Sometimes it receives nothing. It causes pain to use with other libraries that expect at least a null error.

Consider being used in async.waterfall, we have to

  async.waterfall([
    function(next) {
      wrench.copyDirRecursive(
        sourceDir, 
        destDir, 
        function(error) {
          // The problem with wrench is that when succeeds it will call callback
          // with nothing.
          if (error) return next(error);
          next(null);
        });
    },
    function(next) {
       ...
    }], callback);
};

instead of

  async.waterfall([
    function(next) {
      wrench.copyDirRecursive(
        sourceDir, 
        destDir, 
        next)
    },
    function(next) {
       ...
    }], callback);
};
@ryanmcgrath
Copy link
Owner

Your pull request done fixed this here issue. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants