mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 15:58:14 +00:00
feat: load from dotenv if specified
This commit is contained in:
@@ -35,6 +35,12 @@ export interface HeadplaneContext {
|
||||
let context: HeadplaneContext | undefined
|
||||
|
||||
export async function loadContext(): Promise<HeadplaneContext> {
|
||||
const envFile = process.env.LOAD_ENV_FILE === 'true'
|
||||
if (envFile) {
|
||||
log.info('CTXT', 'Loading environment variables from .env')
|
||||
await import('dotenv/config')
|
||||
}
|
||||
|
||||
if (context) {
|
||||
return context
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
"@remix-run/react": "^2.10.2",
|
||||
"@remix-run/serve": "^2.10.2",
|
||||
"clsx": "^2.1.1",
|
||||
"dotenv": "^16.4.5",
|
||||
"isbot": "^5.1.11",
|
||||
"oauth4webapi": "^2.11.1",
|
||||
"react": "19.0.0-rc-f38c22b244-20240704",
|
||||
|
||||
Generated
+3
@@ -52,6 +52,9 @@ importers:
|
||||
clsx:
|
||||
specifier: ^2.1.1
|
||||
version: 2.1.1
|
||||
dotenv:
|
||||
specifier: ^16.4.5
|
||||
version: 16.4.5
|
||||
isbot:
|
||||
specifier: ^5.1.11
|
||||
version: 5.1.11
|
||||
|
||||
Reference in New Issue
Block a user