mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
refactor(plugins): generate SDK egress policy from the server
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
|
||||
const source = new URL('../../server/src/nest/plugins/runtime/egress-policy.ts', import.meta.url);
|
||||
const directory = new URL('../src/generated/', import.meta.url);
|
||||
const target = new URL('egress-policy.ts', directory);
|
||||
|
||||
const policy = readFileSync(source, 'utf8');
|
||||
if (!existsSync(target) || readFileSync(target, 'utf8') !== policy) {
|
||||
mkdirSync(directory, { recursive: true });
|
||||
writeFileSync(target, policy);
|
||||
}
|
||||
Reference in New Issue
Block a user