From 3f39ed5de0cb10492ab7915e1920e7d269f66a96 Mon Sep 17 00:00:00 2001 From: Alfredo Delgado Date: Mon, 12 Jun 2017 18:00:52 -0400 Subject: [PATCH] Workaround async copy bug in `fs-extra` until possible fix (https://github.com/jprichardson/node-fs-extra/pull/374) is published. --- lib/steal-cordova.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/steal-cordova.js b/lib/steal-cordova.js index 154edee..e3c9261 100644 --- a/lib/steal-cordova.js +++ b/lib/steal-cordova.js @@ -66,7 +66,13 @@ StealCordova.prototype = { return glob(files).then(function(files){ var copies = files.map(function(file){ - return copy(file, destPath(file)); + return copy(file, destPath(file)) + .catch(function(error) { + console.error('First attempt at copying', file, + 'failed because of', error, 'Trying again...'); + + return copy(file, destPath(file)); + }); }); // copy the index.html file copies.push(stealCordova.copyIndexHTML(dest));