refactor: expose api for loading demo project

This commit is contained in:
Carlos Valente
2024-11-22 21:43:13 +01:00
committed by Carlos Valente
parent a518dc4882
commit 7bf90d669a
4 changed files with 31 additions and 3 deletions
@@ -59,10 +59,9 @@ export async function getCurrentProject() {
}
/**
* Private function loads a demo project
* to be composed in the loading functions
* Loads the demo project
*/
async function loadDemoProject(): Promise<string> {
export async function loadDemoProject(): Promise<string> {
const pathToNewFile = generateUniqueFileName(publicDir.projectsDir, config.demoProject);
await initPersistence(getPathToProject(pathToNewFile), demoDb);
const newName = getFileNameFromPath(pathToNewFile);