refactor: simplify setup of asset paths

This commit is contained in:
Carlos Valente
2024-10-13 13:53:55 +02:00
committed by Carlos Valente
parent e46948772e
commit 5950551da2
17 changed files with 177 additions and 144 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ import { join } from 'path';
import { ONTIME_VERSION } from '../ONTIME_VERSION.js';
import { get } from '../services/rundown-service/rundownCache.js';
import { getState } from '../stores/runtimeState.js';
import { resolveCrashReportDirectory } from '../setup/index.js';
import { publicDir } from '../setup/index.js';
import { ensureDirectory } from './fileManagement.js';
/**
@@ -13,8 +13,8 @@ import { ensureDirectory } from './fileManagement.js';
* @param content
*/
function writeToFile(fileName: string, content: object) {
const path = join(resolveCrashReportDirectory, fileName);
ensureDirectory(resolveCrashReportDirectory);
const path = join(publicDir.crashDir, fileName);
ensureDirectory(publicDir.crashDir);
try {
const textContent = JSON.stringify(content, null, 2);