mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
5b01329c37
* refactor: migrate project upload
19 lines
593 B
TypeScript
19 lines
593 B
TypeScript
import { copyFileSync, existsSync } from 'fs';
|
|
import { pathToStartStyles, resolveStylesDirectory, resolveStylesPath } from './index.js';
|
|
import { ensureDirectory } from '../utils/fileManagement.js';
|
|
|
|
/**
|
|
* @description ensures directories exist and populates stylesheet
|
|
*/
|
|
export const populateStyles = () => {
|
|
ensureDirectory(resolveStylesDirectory);
|
|
// if styles doesn't exist we want to use startup stylesheet
|
|
if (!existsSync(resolveStylesPath)) {
|
|
try {
|
|
copyFileSync(pathToStartStyles, resolveStylesPath);
|
|
} catch (_) {
|
|
/* we do not handle this */
|
|
}
|
|
}
|
|
};
|