Skip to content

Commit

Permalink
chore: add fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Pagebakers committed Nov 4, 2023
1 parent f765231 commit 688df2e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/website/src/data/blocks/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
)
}

Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit 688df2e

Please sign in to comment.