Allow filtering to a specific type of asset task.

This commit is contained in:
flash 2025-04-11 18:15:50 +00:00
parent 99e3e3111a
commit 0d8283495d
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E

View file

@ -41,10 +41,20 @@ const fs = require('fs');
],
};
const files = await assproc.process(env, tasks);
const infoPath = process.env.ASSET_INFO_PATH ?? pathJoin(__dirname, 'assets/current.json');
let files = {};
fs.writeFileSync(
pathJoin(__dirname, 'assets/current.json'),
JSON.stringify(files),
);
if(process.argv.length > 2) {
files = JSON.parse(fs.readFileSync(infoPath));
const filter = process.argv.slice(2);
for(const name in tasks)
if(!filter.includes(name))
delete tasks[name];
}
fs.writeFileSync(infoPath, JSON.stringify({
...files,
...await assproc.process(env, tasks),
}));
})();