The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Skip front config generation if index isn't writable (#13094)
Niklas Korz10c9d11e1598
diff --git a/packages/twenty-server/src/utils/generate-front-config.ts b/packages/twenty-server/src/utils/generate-front-config.tsindex c842a2592b4..6069fbbfe71 100644--- a/packages/twenty-server/src/utils/generate-front-config.ts+++ b/packages/twenty-server/src/utils/generate-front-config.ts@@ -25,21 +25,19 @@ export function generateFrontConfig(): void {const distPath = path.join(__dirname, '../..', 'front');const indexPath = path.join(distPath, 'index.html');- if (!fs.existsSync(indexPath)) {+ try {+ let indexContent = fs.readFileSync(indexPath, 'utf8');++ indexContent = indexContent.replace(+ /<!-- BEGIN: Twenty Config -->[\s\S]*?<!-- END: Twenty Config -->/,+ configString,+ );++ fs.writeFileSync(indexPath, indexContent, 'utf8');+ } catch {// eslint-disable-next-line no-consoleconsole.log(- 'Frontend build not found, assuming it is served independently',+ 'Frontend build not found or not writable, assuming it is served independently',);-- return;}-- let indexContent = fs.readFileSync(indexPath, 'utf8');-- indexContent = indexContent.replace(- /<!-- BEGIN: Twenty Config -->[\s\S]*?<!-- END: Twenty Config -->/,- configString,- );-- fs.writeFileSync(indexPath, indexContent, 'utf8');}