@dotenvx/dotenvx 0.15.3 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/actions/run.js +1 -1
- package/src/lib/main.js +12 -3
package/package.json
CHANGED
package/src/cli/actions/run.js
CHANGED
|
@@ -78,7 +78,7 @@ async function run () {
|
|
|
78
78
|
|
|
79
79
|
try {
|
|
80
80
|
const src = fs.readFileSync(filepath, { encoding: ENCODING })
|
|
81
|
-
const parsed = main.parseExpand(src)
|
|
81
|
+
const parsed = main.parseExpand(src, options.overload)
|
|
82
82
|
const result = main.inject(process.env, parsed, options.overload)
|
|
83
83
|
|
|
84
84
|
readableFilepaths.add(envFilepath)
|
package/src/lib/main.js
CHANGED
|
@@ -36,11 +36,20 @@ const parse = function (src) {
|
|
|
36
36
|
return result
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const parseExpand = function (src) {
|
|
39
|
+
const parseExpand = function (src, overload) {
|
|
40
40
|
const parsed = dotenv.parse(src)
|
|
41
|
+
|
|
42
|
+
// consider moving this logic straight into dotenv-expand
|
|
43
|
+
let inputParsed = {}
|
|
44
|
+
if (overload) {
|
|
45
|
+
inputParsed = { ...process.env, ...parsed }
|
|
46
|
+
} else {
|
|
47
|
+
inputParsed = { ...parsed, ...process.env }
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
const expandPlease = {
|
|
42
|
-
processEnv: {},
|
|
43
|
-
parsed:
|
|
51
|
+
processEnv: {},
|
|
52
|
+
parsed: inputParsed
|
|
44
53
|
}
|
|
45
54
|
const expanded = dotenvExpand.expand(expandPlease).parsed
|
|
46
55
|
|