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.data = null;
this.dir = null; this.dir = null;
this.assets = ["logo", "photo"]; this.assets = ["logo", "photo"];
this.haveSync = false;
} }
async load(path) { 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; this.data = data;
} }
async sync() { async sync() {
const syncFile = [this.dir, "_sync.js"].join("/"); if (!this.haveSync) return null;
if (!await exists(syncFile)) return null;
if (!_silentMode) console.log(`syncing ${this.id} ..`); if (!_silentMode) console.log(`syncing ${this.id} ..`);
const module = await import("../" + syncFile); const module = await import("../" + this.syncFile);
// data // data
if (module.data) { if (module.data) {
const data = await module.data(syncTools); const data = await module.data(syncTools);

Zobrazit soubor

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