fix: missing demo logo (#1954)

This commit is contained in:
Alex Christoffer Rasmussen
2026-01-26 13:52:29 +01:00
committed by GitHub
parent 7b5f797c95
commit 04c5b67475
3 changed files with 22 additions and 0 deletions
@@ -37,6 +37,7 @@ import {
moveCorruptFile,
parseJsonFile,
} from './projectServiceUtils.js';
import { populateOntimeLogo } from '../../setup/loadOntimeLogo.js';
type ProjectState =
| {
@@ -113,6 +114,7 @@ async function loadProject(projectData: DatabaseModel, fileName: string, rundown
* Loads the demo project
*/
export async function loadDemoProject(): Promise<string> {
populateOntimeLogo();
return createProject(config.demoProject, demoDb);
}
+2
View File
@@ -95,6 +95,8 @@ export const srcFiles = {
translationReadme: join(srcDir.root, config.user, config.translations.directory, 'README.md'),
/** Path to login */
login: join(srcDir.root, 'html/login.html'),
/** Path to ontime-logo */
logo: join(srcDir.root, config.user, config.logo, 'ontime-logo.png'),
};
/**
+18
View File
@@ -0,0 +1,18 @@
import { copyFileSync } from 'fs';
import { ensureDirectory } from '../utils/fileManagement.js';
import { publicDir, srcFiles } from './index.js';
import { basename, join } from 'path';
/**
* @description ensures directories exist and populates ontime logo
*/
export function populateOntimeLogo() {
ensureDirectory(publicDir.logoDir);
try {
const logoName = basename(srcFiles.logo);
copyFileSync(srcFiles.logo, join(publicDir.logoDir, logoName));
} catch (_) {
/* we do not handle this */
}
}