This commit is contained in:
tree 2023-03-28 05:03:25 +02:00
rodič 45c8f4b0a8
revize 9be806bfbd
2 změnil soubory, kde provedl 11 přidání a 3 odebrání

Zobrazit soubor

@ -190,6 +190,7 @@ class DeConf_Collection {
this.data = null;
this.dir = null;
this.assets = ["logo", "photo"];
this.haveSync = false;
}
async load(path) {
@ -243,14 +244,18 @@ class DeConf_Collection {
}
}
}
// check if sync file exists
this.syncFile = [this.dir, "_sync.js"].join("/");
if (await exists(this.syncFile)) {
this.haveSync = true;
}
this.data = data;
}
async sync() {
const syncFile = [this.dir, "_sync.js"].join("/");
if (!await exists(syncFile)) return null;
if (!this.haveSync) return null;
if (!_silentMode) console.log(`syncing ${this.id} ..`);
const module = await import("../" + syncFile);
const module = await import("../" + this.syncFile);
// data
if (module.data) {
const data = await module.data(syncTools);

Zobrazit soubor

@ -12,6 +12,9 @@ if (Deno.args[0]) {
await ev.sync();
} else {
for (const event of entry.data.events) {
if (!event.haveSync) {
continue;
}
await event.sync();
}
}