Fixed: Make sure Jakefile both work for async and sync calls

The callback variable was not set if the call to initilize was synchronous.
It is now set before so both sync and async will work
This commit is contained in:
Martin Carlberg
2022-12-09 10:15:38 +01:00
committed by GitHub
parent 2b07c4b662
commit 5932a07eb2
+3 -3
View File
@@ -8,8 +8,6 @@ function callbackFunction(blendtask) {
callback(blendtask);
}
require("../../../CommonJS/lib/cappuccino/jake.js").initilize(callbackFunction);
$BUILD_CJS_BLENDTASK = path.join($BUILD_CJS_CAPPUCCINO, "lib", "cappuccino", "jake", "blendtask.j");
var promise = new Promise((resolve, reject) => {
@@ -23,6 +21,8 @@ var promise = new Promise((resolve, reject) => {
}
});
require("../../../CommonJS/lib/cappuccino/jake.js").initilize(callbackFunction);
async function defineBlendTask() {
await exports.blend ("Aristo2.blend", function(aristoTask)
{
@@ -36,4 +36,4 @@ async function defineBlendTask() {
task ("build", ["Aristo2.blend"]);
}
exports.jakePromise = promise;
exports.jakePromise = promise;