@dotenvx/dotenvx 1.30.0 → 1.30.1
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/CHANGELOG.md +8 -2
- package/package.json +1 -1
- package/src/lib/helpers/parse.js +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.30.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.30.1...main)
|
|
6
|
+
|
|
7
|
+
## [1.30.1](https://github.com/dotenvx/dotenvx/compare/v1.30.0...v1.30.1)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* support complex command substitution combining variable expansion ([#490](https://github.com/dotenvx/dotenvx/pull/490))
|
|
6
12
|
|
|
7
13
|
## [1.30.0](https://github.com/dotenvx/dotenvx/compare/v1.29.0...v1.30.0)
|
|
8
14
|
|
|
@@ -10,7 +16,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
10
16
|
|
|
11
17
|
* add `-fk` (`--env-keys-file`) flag to customize the path to your `.env.keys` file with `run, get, set, encrypt, decrypt, and keypair` 🎉 ([#486](https://github.com/dotenvx/dotenvx/pull/486))
|
|
12
18
|
|
|
13
|
-
This is great for monorepos. Maintain one `.env.keys` file across
|
|
19
|
+
This is great for monorepos. Maintain one `.env.keys` file across all your apps.
|
|
14
20
|
|
|
15
21
|
```sh
|
|
16
22
|
$ dotenvx encrypt -fk .env.keys -f apps/backend/.env
|
package/package.json
CHANGED
package/src/lib/helpers/parse.js
CHANGED
|
@@ -136,10 +136,9 @@ class Parse {
|
|
|
136
136
|
eval (value) {
|
|
137
137
|
// Match everything between the outermost $() using a regex with non-capturing groups
|
|
138
138
|
const matches = value.match(/\$\(([^)]+(?:\)[^(]*)*)\)/g) || []
|
|
139
|
-
|
|
140
|
-
return matches.reduce(function (newValue, match) {
|
|
139
|
+
return matches.reduce((newValue, match) => {
|
|
141
140
|
const command = match.slice(2, -1) // Extract command by removing $() wrapper
|
|
142
|
-
const result = chomp(execSync(command).toString()) // execute command
|
|
141
|
+
const result = chomp(execSync(command, { env: { ...this.processEnv, ...this.runningParsed } }).toString()) // execute command (including runningParsed)
|
|
143
142
|
return newValue.replace(match, result) // Replace match with result
|
|
144
143
|
}, value)
|
|
145
144
|
}
|