From 90a762f8a5f3e55b02418992cf264666ac6a5673 Mon Sep 17 00:00:00 2001 From: Mani Maghsoudlou Date: Fri, 31 Aug 2018 00:10:24 -0700 Subject: [PATCH] destructure stats object after checkign err --- lib/copy/copy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/copy/copy.js b/lib/copy/copy.js index 7483477d..5890f7ce 100644 --- a/lib/copy/copy.js +++ b/lib/copy/copy.js @@ -159,8 +159,9 @@ function copyDirItems (items, src, dest, opts, cb) { function copyDirItem (items, item, src, dest, opts, cb) { const srcItem = path.join(src, item) const destItem = path.join(dest, item) - checkPaths(srcItem, destItem, (err, {destStat}) => { + checkPaths(srcItem, destItem, (err, stats) => { if (err) return cb(err) + const {destStat} = stats startCopy(destStat, srcItem, destItem, opts, err => { if (err) return cb(err) return copyDirItems(items, src, dest, opts, cb)