From 688df2e26cb4e8a777d1400c16a28571ede1903d Mon Sep 17 00:00:00 2001 From: Pagebakers Date: Sat, 4 Nov 2023 19:04:34 +0100 Subject: [PATCH] chore: add fallback --- apps/website/src/data/blocks/components.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/website/src/data/blocks/components.ts b/apps/website/src/data/blocks/components.ts index 88cee4a64..526bd3a5e 100644 --- a/apps/website/src/data/blocks/components.ts +++ b/apps/website/src/data/blocks/components.ts @@ -59,9 +59,12 @@ function getComponentCode(componentFolder: string, componentName: string) { } const getRootFolder = () => { - return path.join( - process.env.PROJECT_CWD ?? __dirname + '/../../../../', - '/packages/pro/saas-ui/templates/src' + return ( + process.env.TEMPLATE_ROOT || + path.join( + process.env.PROJECT_CWD ?? __dirname + '/../../../../', + '/packages/pro/saas-ui/templates/src' + ) ) } @@ -111,6 +114,7 @@ export function getComponent( componentName: string, rootFolder = getRootFolder() ): ComponentInfo | null { + console.log('rootFolder', rootFolder) const componentDirectory = path.join(rootFolder, categoryName, componentName) const componentAttributes = path.join(componentDirectory, 'attributes.json')