mirror of
https://gitea.redwind.top/Austin/subscription
synced 2024-11-16 12:22:20 +08:00
perf: check app config file
This commit is contained in:
parent
38ace74d98
commit
935259f081
|
@ -8,6 +8,9 @@ import type { RawApp } from './types';
|
|||
|
||||
const rawApps: RawApp[] = [];
|
||||
for await (const tsFp of walk(process.cwd() + '/src/apps')) {
|
||||
if (!tsFp.endsWith('.ts')) {
|
||||
throw new Error('invalid typescript app config file: ' + tsFp);
|
||||
}
|
||||
const mod: { default: RawApp } = await import(url.pathToFileURL(tsFp).href);
|
||||
const appConfig = mod.default;
|
||||
if (path.basename(tsFp, '.ts') != appConfig.id) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user