From 674c01ce56713f1257aece3502b87f15ca292521 Mon Sep 17 00:00:00 2001 From: Tobias Brennecke Date: Fri, 24 Feb 2017 13:04:04 +0100 Subject: [PATCH] Fix #629 Race condition when loading starter kits --- core/lib/starterkit_manager.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/lib/starterkit_manager.js b/core/lib/starterkit_manager.js index db4153486..77fbf91a2 100644 --- a/core/lib/starterkit_manager.js +++ b/core/lib/starterkit_manager.js @@ -36,12 +36,13 @@ var starterkit_manager = function (config) { console.log('Overwriting contents of', paths.source.root, 'during starterkit load.'); } - fs.copy(kitPath, paths.source.root, function (ex) { - if (ex) { - console.error(ex); - } - util.debug('starterkit ' + starterkitName + ' loaded successfully.'); - }); + try { + fs.copySync(kitPath, paths.source.root); + } catch (ex) { + util.error(ex); + return; + } + util.debug('starterkit ' + starterkitName + ' loaded successfully.'); } } catch (ex) { console.log(ex);