better handling all around for files and symlinks

This commit is contained in:
2023-10-17 23:09:36 +02:00
parent 5bee1b6382
commit d8ca28f2ff
14 changed files with 90 additions and 260 deletions

View File

@@ -0,0 +1,12 @@
import fs from 'fs';
import 'dotenv/config';
import { symlinkSync } from 'fs';
const target = process.env.STREAM_MEDIA_LOCATION;
const linkName = './build/client/media';
try {
symlinkSync(target, linkName);
console.log(`Symlink created: ${linkName} -> ${target}`);
} catch (err) {
console.error(`Error creating symlink: ${err}`);
}