mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
* copy from branding folder to backend public folder provide default branding/public folder * copy public folder correctly * copy files again for providers.json * copy more public folders * more copy * revert change * fix naming of called script when using db:data:branding * prod command for branding data * close database connection * lint fixes * increase test timeout again
28 lines
865 B
TypeScript
28 lines
865 B
TypeScript
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
import { readdir } from 'node:fs/promises'
|
|
import path from 'node:path'
|
|
|
|
import { getNeode } from './neo4j'
|
|
|
|
const dataFolder = path.join(__dirname, 'data/')
|
|
const neode = getNeode()
|
|
|
|
;(async function () {
|
|
const files = await readdir(dataFolder)
|
|
for await (const file of files) {
|
|
if (file.slice(0, -3).endsWith('-branding')) {
|
|
const importedModule = await import(path.join(dataFolder, file))
|
|
if (!importedModule.default) {
|
|
throw new Error('Your data file must export a default function')
|
|
}
|
|
await importedModule.default()
|
|
}
|
|
}
|
|
|
|
// close database connection
|
|
neode.close()
|
|
})()
|