refactor: migrate project upload (#796)

* refactor: migrate project upload
This commit is contained in:
Carlos Valente
2024-03-01 22:59:00 +01:00
committed by GitHub
parent 8df419d835
commit 5b01329c37
54 changed files with 698 additions and 1134 deletions
+18
View File
@@ -0,0 +1,18 @@
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 */
}
}
};