mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 07:48:14 +00:00
fix: skip loading env file if context is loaded
This commit is contained in:
@@ -35,16 +35,16 @@ export interface HeadplaneContext {
|
||||
let context: HeadplaneContext | undefined
|
||||
|
||||
export async function loadContext(): Promise<HeadplaneContext> {
|
||||
if (context) {
|
||||
return context
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
const debug = process.env.DEBUG === 'true'
|
||||
if (debug) {
|
||||
log.info('CTXT', 'Debug mode is enabled! Logs will spam a lot.')
|
||||
|
||||
Reference in New Issue
Block a user