Altered vars handling.

This commit is contained in:
flash 2024-06-10 03:25:20 +00:00
parent 36414468dc
commit 99b8f4919b

View file

@ -33,9 +33,6 @@ module.exports.process = async (env, tasks) => {
const files = {};
for(const type of order) {
if(!types.hasOwnProperty(type))
continue;
if(!(type in types))
throw `${type} is not a supported build task type`;
@ -54,8 +51,9 @@ module.exports.process = async (env, tasks) => {
console.info(` => ${task.source}...`);
const path = await handler.process(task, vars);
if(typeof task.varsName === 'string')
vars[task.varsGroup ?? ''][task.varsName] = path;
if(typeof task.vars === 'object' && task.vars !== null)
for(const varsGroup in task.vars)
vars[varsGroup][task.vars[varsGroup] === ':source' ? task.source : task.vars[varsGroup]] = path;
files[task.source] = path;
}