feat: load from dotenv if specified
This commit is contained in:
parent
0c1f6969da
commit
9dafd8e8b0
@ -35,6 +35,12 @@ export interface HeadplaneContext {
|
|||||||
let context: HeadplaneContext | undefined
|
let context: HeadplaneContext | undefined
|
||||||
|
|
||||||
export async function loadContext(): Promise<HeadplaneContext> {
|
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) {
|
if (context) {
|
||||||
return context
|
return context
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
"@remix-run/react": "^2.10.2",
|
"@remix-run/react": "^2.10.2",
|
||||||
"@remix-run/serve": "^2.10.2",
|
"@remix-run/serve": "^2.10.2",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
|
"dotenv": "^16.4.5",
|
||||||
"isbot": "^5.1.11",
|
"isbot": "^5.1.11",
|
||||||
"oauth4webapi": "^2.11.1",
|
"oauth4webapi": "^2.11.1",
|
||||||
"react": "19.0.0-rc-f38c22b244-20240704",
|
"react": "19.0.0-rc-f38c22b244-20240704",
|
||||||
|
|||||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@ -52,6 +52,9 @@ importers:
|
|||||||
clsx:
|
clsx:
|
||||||
specifier: ^2.1.1
|
specifier: ^2.1.1
|
||||||
version: 2.1.1
|
version: 2.1.1
|
||||||
|
dotenv:
|
||||||
|
specifier: ^16.4.5
|
||||||
|
version: 16.4.5
|
||||||
isbot:
|
isbot:
|
||||||
specifier: ^5.1.11
|
specifier: ^5.1.11
|
||||||
version: 5.1.11
|
version: 5.1.11
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user