mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-01 17:03:15 +00:00
12 lines
494 B
JavaScript
12 lines
494 B
JavaScript
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);
|
|
}
|