From 985eed9c2ca75e33958dcbe693423d820403ca78 Mon Sep 17 00:00:00 2001 From: Angeline Loh Date: Tue, 28 May 2019 17:07:25 +1200 Subject: [PATCH] Fix fs.copy twice with glob path fails second time because it tries to do copySingle with the glob path as the glob path is currently in store. (#132) --- lib/actions/copy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/actions/copy.js b/lib/actions/copy.js index c6a1d8e..7d2982c 100644 --- a/lib/actions/copy.js +++ b/lib/actions/copy.js @@ -24,7 +24,8 @@ exports.copy = function (from, to, options, context, tplSettings) { var diskFiles = globby.sync(fromGlob, globOptions); var storeFiles = []; this.store.each(file => { - if (multimatch([file.path], fromGlob).length !== 0) { + // The store may have a glob path and when we try to copy it will fail because not real file + if (!glob.hasMagic(file.path) && multimatch([file.path], fromGlob).length !== 0) { storeFiles.push(file.path); } });