Commit 5e1dd667 authored by Isabella Skořepová's avatar Isabella Skořepová

Fix race condition

(hopefully)
parent 4305d8c4
Pipeline #385 canceled with stages
in 6 seconds
......@@ -30,6 +30,7 @@ var sitegin = function(config) {
// If it is running - schedule rerun after it finishes
var isRunning = false;
var runAgain = false;
var first = false;
var doSync = function(){}
function run() {
var startTime = moment();
......@@ -47,6 +48,10 @@ var sitegin = function(config) {
isRunning = false;
console.log('Generator finished in',moment().diff(startTime,'seconds'),'seconds')
doSync();
if(!first) {
first = true;
copyStaticFiles(config.builddir, config.staticDir, config.themeDir);
}
if(runAgain) run();
})
.catch(function(e) {
......@@ -63,7 +68,7 @@ var sitegin = function(config) {
console.log('Sitegin successfully loaded');
run();
copyStaticFiles(config.builddir, config.staticDir, config.themeDir);
rendersass(config.builddir, config.themeDir);
if(!options.noserver) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment