Intracto/buildozer

Callbacks return too fast

MartijnCuppens opened this issue · 2 comments

The callbacks in the gulp tasks just run when when all tasks are initiated, not when they are finished. For example for the CSS:

function css(cb) {
config.scss.forEach(scss => {
cssCompile(config.src_base_path + scss.src, config.dest_base_path + scss.dest, true);
});
cb();
}

We'll probably need to add all the tasks to an array and return the callback only when every task is finished.

Same issue for js and img tasks.

I tried this, with no success:

function css(cb) {
  config.scss.forEach(async scss => {
    await cssCompile({src: config.src_base_path + scss.src, dest: config.dest_base_path + scss.dest});
  });
  cb();
}

Also tried to add each cssCompile function to an array which is returned in the end, also didn't work. I haven't figured out how all these callbacks work exactly, if there's anyone who can help me out with this, feel free to contribute ❤️

Could you elaborate what this issue causes? Does it trigger a reload too fast or? And how can I reproduce?