Files
twenty/packages/twenty-sdk/src/cli/utilities/file/utils/file-env.ts
T
Charles Bochet e61b92132c Rework folder structure (#17230)
<img width="700" height="771" alt="image"
src="https://github.com/user-attachments/assets/b784fbe6-f976-4c9a-84c1-3d90a9010665"
/>

Second one :)
2026-01-19 14:08:05 +00:00

18 lines
390 B
TypeScript

import * as fs from 'fs-extra';
import dotenv from 'dotenv';
import { findPathFile } from './file-find';
export const loadEnvVariables = async (appPath: string) => {
let envFile = '';
try {
const envFilePath = await findPathFile(appPath, '.env');
envFile = await fs.readFile(envFilePath, 'utf8');
} catch {
// Allow missing .env
}
return dotenv.parse(envFile);
};