@dotenvx/dotenvx 1.19.1 → 1.19.3
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 +13 -1
- package/README.md +11 -0
- package/package.json +1 -1
- package/src/lib/helpers/executeCommand.js +10 -9
- package/src/lib/helpers/replace.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
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.19.
|
|
5
|
+
## [Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.19.3...main)
|
|
6
|
+
|
|
7
|
+
## 1.19.3
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* 🐞 fix decrypt re-encrypt of values containing backslashes ([#406](https://github.com/dotenvx/dotenvx/pull/407))
|
|
12
|
+
|
|
13
|
+
## 1.19.2
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* forward additional signals like `SIGUSR2` ([#403](https://github.com/dotenvx/dotenvx/pull/403))
|
|
6
18
|
|
|
7
19
|
## 1.19.1
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -431,6 +431,17 @@ More examples
|
|
|
431
431
|
Hello World
|
|
432
432
|
```
|
|
433
433
|
|
|
434
|
+
</details>
|
|
435
|
+
* <details><summary>asdf</summary><br>
|
|
436
|
+
|
|
437
|
+
```sh
|
|
438
|
+
# use dotenvx with asdf
|
|
439
|
+
$ asdf plugin add dotenvx
|
|
440
|
+
$ asdf install dotenvx latest
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
thank you [@jgburet](https://github.com/jgburet/asdf-dotenvx) of Paris 🇫🇷
|
|
444
|
+
|
|
434
445
|
</details>
|
|
435
446
|
* <details><summary>Git</summary><br>
|
|
436
447
|
|
package/package.json
CHANGED
|
@@ -11,19 +11,19 @@ async function executeCommand (commandArgs, env) {
|
|
|
11
11
|
|
|
12
12
|
logger.debug(`executing process command [${commandArgs.join(' ')}]`)
|
|
13
13
|
|
|
14
|
-
let
|
|
14
|
+
let child
|
|
15
15
|
let signalSent
|
|
16
16
|
|
|
17
17
|
/* c8 ignore start */
|
|
18
18
|
const sigintHandler = () => {
|
|
19
19
|
logger.debug('received SIGINT')
|
|
20
20
|
logger.debug('checking command process')
|
|
21
|
-
logger.debug(
|
|
21
|
+
logger.debug(child)
|
|
22
22
|
|
|
23
|
-
if (
|
|
23
|
+
if (child) {
|
|
24
24
|
logger.debug('sending SIGINT to command process')
|
|
25
25
|
signalSent = 'SIGINT'
|
|
26
|
-
|
|
26
|
+
child.kill('SIGINT') // Send SIGINT to the command process
|
|
27
27
|
} else {
|
|
28
28
|
logger.debug('no command process to send SIGINT to')
|
|
29
29
|
}
|
|
@@ -32,12 +32,12 @@ async function executeCommand (commandArgs, env) {
|
|
|
32
32
|
const sigtermHandler = () => {
|
|
33
33
|
logger.debug('received SIGTERM')
|
|
34
34
|
logger.debug('checking command process')
|
|
35
|
-
logger.debug(
|
|
35
|
+
logger.debug(child)
|
|
36
36
|
|
|
37
|
-
if (
|
|
37
|
+
if (child) {
|
|
38
38
|
logger.debug('sending SIGTERM to command process')
|
|
39
39
|
signalSent = 'SIGTERM'
|
|
40
|
-
|
|
40
|
+
child.kill('SIGTERM') // Send SIGTERM to the command process
|
|
41
41
|
} else {
|
|
42
42
|
logger.debug('no command process to send SIGTERM to')
|
|
43
43
|
}
|
|
@@ -45,6 +45,7 @@ async function executeCommand (commandArgs, env) {
|
|
|
45
45
|
|
|
46
46
|
const handleOtherSignal = (signal) => {
|
|
47
47
|
logger.debug(`received ${signal}`)
|
|
48
|
+
child.kill(signal)
|
|
48
49
|
}
|
|
49
50
|
/* c8 ignore stop */
|
|
50
51
|
|
|
@@ -73,7 +74,7 @@ async function executeCommand (commandArgs, env) {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
child = execute.execa(commandArgs[0], commandArgs.slice(1), {
|
|
77
78
|
stdio: 'inherit',
|
|
78
79
|
env: { ...process.env, ...env }
|
|
79
80
|
})
|
|
@@ -86,7 +87,7 @@ async function executeCommand (commandArgs, env) {
|
|
|
86
87
|
})
|
|
87
88
|
|
|
88
89
|
// Wait for the command process to finish
|
|
89
|
-
const { exitCode } = await
|
|
90
|
+
const { exitCode } = await child
|
|
90
91
|
|
|
91
92
|
if (exitCode !== 0) {
|
|
92
93
|
logger.debug(`received exitCode ${exitCode}`)
|
|
@@ -13,6 +13,12 @@ function replace (src, key, replaceValue) {
|
|
|
13
13
|
escapedValue = escapedValue.replace(/\\n/g, '\n') // fix up newlines
|
|
14
14
|
escapedValue = escapedValue.replace(/\\r/g, '\r')
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
// prevents test\test (and similar) from becoming test\\test and then test\\\\test, etc recursively after each encrypt/decrypt combo
|
|
18
|
+
if (replaceValue.includes('\\')) {
|
|
19
|
+
escapedValue = escapedValue.replace(/\\\\/g, '\\')
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
let newPart = `${key}=${escapedValue}`
|
|
17
23
|
|
|
18
24
|
const parsed = dotenv.parse(src)
|