feat(utils): use dotenv-expand to allow variables within env (#8720)
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
"awilix": "^8.0.1",
|
||||
"bignumber.js": "^9.1.2",
|
||||
"dotenv": "^16.4.5",
|
||||
"dotenv-expand": "^11.0.6",
|
||||
"json-2-csv": "^5.5.4",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"knex": "2.4.2",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import dotenv from "dotenv"
|
||||
import { expand } from "dotenv-expand"
|
||||
import { join } from "path"
|
||||
const KNOWN_ENVIRONMENTS = ["staging", "production", "test"]
|
||||
|
||||
@@ -19,6 +20,6 @@ export function loadEnv(environment: string, envDir: string) {
|
||||
? `.env.${environment}`
|
||||
: ".env"
|
||||
try {
|
||||
dotenv.config({ path: join(envDir, fileToLoad) })
|
||||
expand(dotenv.config({ path: join(envDir, fileToLoad) }))
|
||||
} catch {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user