Skip to content

Commit

Permalink
feat: Implement dotenv-expand.This allows us to expand env variables …
Browse files Browse the repository at this point in the history
…into dotenv files.For example, to get read the environment variable npm_package_version (#238)
  • Loading branch information
zenios authored and develar committed Jan 15, 2019
1 parent fca5a0e commit 8b01224
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/electron-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"css-loader": "^1.0.1",
"debug": "^4.1.0",
"dotenv": "^6.1.0",
"dotenv-expand": "^4.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-webpack-js": "~2.3.0",
"file-loader": "^2.0.0",
Expand Down
9 changes: 6 additions & 3 deletions packages/electron-webpack/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BluebirdPromise from "bluebird-lst"
import { config as dotEnvConfig } from "dotenv"
import dotEnvExpand from "dotenv-expand"
import { pathExists, readJson } from "fs-extra-p"
import { Lazy } from "lazy-val"
import * as path from "path"
Expand Down Expand Up @@ -345,9 +346,11 @@ export async function configure(type: ConfigurationType, env: ConfigurationEnv |
for (const file of dotenvFiles) {
const exists = await pathExists(file)
if (exists) {
dotEnvConfig({
path: file
})
dotEnvExpand(
dotEnvConfig({
path: file
})
)
}
}
return await configurator.configure()
Expand Down

0 comments on commit 8b01224

Please sign in to comment.