Skip to content

Commit

Permalink
fix(expand): expand after all configs are loaded (#101)
Browse files Browse the repository at this point in the history
Co-authored-by: Bero <[email protected]>
  • Loading branch information
bhunjadi and Bero authored Dec 20, 2024
1 parent 8350d87 commit ad278c0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,15 @@ if (argv.debug) {
}

paths.forEach(function (env) {
const parsedFile = dotenv.config({ path: path.resolve(env), override })
if (argv.expand !== false) {
dotenvExpand(parsedFile)
}
dotenv.config({ path: path.resolve(env), override })
})

// Expand when all path configs are loaded
if (argv.expand !== false) {
dotenvExpand({
parsed: process.env
});
}
Object.assign(process.env, parsedVariables)

if (argv.p) {
Expand Down

0 comments on commit ad278c0

Please sign in to comment.