From 32aef4979ce9cd5dafa4a3f706077335b27ee80b Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 6 Jan 2020 16:42:55 +0800 Subject: [PATCH] fix(v3): Source and destination must not be the same --- packages/uni-migration/lib/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/uni-migration/lib/index.js b/packages/uni-migration/lib/index.js index 06183ec345..2502a80c6b 100644 --- a/packages/uni-migration/lib/index.js +++ b/packages/uni-migration/lib/index.js @@ -39,7 +39,11 @@ module.exports = function migrate(input, out, options = {}) { ) ) { options.silent !== true && console.log(`copy: ${dest}`) - src !== dest && fs.copySync(src, dest) + try { + fs.copySync(src, dest) + } catch (e) { + //ignore Source and destination must not be the same + } } } else { options.silent !== true && console.log(`write: ${path.resolve(out, asset.path)}`) -- GitLab