feat: load from dotenv if specified
This commit is contained in:
parent
0c1f6969da
commit
9dafd8e8b0
3 changed files with 10 additions and 0 deletions
|
|
@ -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",
|
||||
|
|
|
|||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue