This commit is contained in:
tree 2023-04-19 01:40:17 +02:00
rodič 5c16e03a60
revize dff3e06475
1 změnil soubory, kde provedl 9 přidání a 3 odebrání

Zobrazit soubor

@ -344,13 +344,19 @@ class DeConf_Collection {
async assetsWrite(outputDir, publicUrl) {
const x = { ...this.data.sync, ...this.data.index };
for (const asset of this.assets) {
if (!x[asset]) continue;
const fnIn = x[asset];
let fnIn = x[asset];
//console.log(fnIn, asset);
const fnOut = [this.id, asset].join("/");
let fnOut = [this.id, asset].join("/");
await emptyDir([outputDir, this.id].join("/"));
const opPath = fnIn.replace(/[^\.]+$/, "op.webp");
const opOutPath = fnIn.replace(/[^\.]+$/, "webp");
const opFn = [this.dir, opPath].join("/");
if (await exists(opFn)) {
fnIn = opPath;
fnOut = [this.id, opOutPath].join("/");
}
await _fileCopy([this.dir, fnIn].join("/"), [outputDir, fnOut].join("/"));
const url = [publicUrl, fnOut].join("/");
this.data.index[asset] = url;