@dotenvx/dotenvx 0.36.0 → 0.36.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/README.md +1 -0
- package/package.json +1 -1
- package/src/cli/actions/run.js +18 -2
package/README.md
CHANGED
|
@@ -732,6 +732,7 @@ $ dotenvx hub push
|
|
|
732
732
|
* [`dotenvx get`](https://dotenvx.com/docs/features/get) – return a single environment variable
|
|
733
733
|
* [`dotenvx set`](https://dotenvx.com/docs/features/set) – set a single environment variable
|
|
734
734
|
* [`dotenvx ls`](https://dotenvx.com/docs/features/ls) – list all .env files in your repo
|
|
735
|
+
* [`dotenvx status`](https://dotenvx.com/docs/features/status) – compare your .env* content(s) to your .env.vault decrypted content(s)
|
|
735
736
|
* [`dotenvx settings`](https://dotenvx.com/docs/features/settings) – print current dotenvx settings
|
|
736
737
|
|
|
737
738
|
|
package/package.json
CHANGED
package/src/cli/actions/run.js
CHANGED
|
@@ -8,7 +8,7 @@ const Run = require('./../../lib/services/run')
|
|
|
8
8
|
const executeCommand = async function (commandArgs, env) {
|
|
9
9
|
const signals = [
|
|
10
10
|
'SIGHUP', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',
|
|
11
|
-
'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2'
|
|
11
|
+
'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2'
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
logger.debug(`executing process command [${commandArgs.join(' ')}]`)
|
|
@@ -27,6 +27,19 @@ const executeCommand = async function (commandArgs, env) {
|
|
|
27
27
|
logger.debug('no command process to send SIGINT to')
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
// handler for SIGTERM
|
|
31
|
+
const sigtermHandler = () => {
|
|
32
|
+
logger.debug('received SIGTERM')
|
|
33
|
+
logger.debug('checking command process')
|
|
34
|
+
logger.debug(commandProcess)
|
|
35
|
+
|
|
36
|
+
if (commandProcess) {
|
|
37
|
+
logger.debug('sending SIGTERM to command process')
|
|
38
|
+
commandProcess.kill('SIGTERM') // Send SIGTEM to the command process
|
|
39
|
+
} else {
|
|
40
|
+
logger.debug('no command process to send SIGTERM to')
|
|
41
|
+
}
|
|
42
|
+
}
|
|
30
43
|
|
|
31
44
|
const handleOtherSignal = (signal) => {
|
|
32
45
|
logger.debug(`received ${signal}`)
|
|
@@ -47,6 +60,7 @@ const executeCommand = async function (commandArgs, env) {
|
|
|
47
60
|
})
|
|
48
61
|
|
|
49
62
|
process.on('SIGINT', sigintHandler)
|
|
63
|
+
process.on('SIGTERM', sigtermHandler)
|
|
50
64
|
|
|
51
65
|
signals.forEach(signal => {
|
|
52
66
|
process.on(signal, () => handleOtherSignal(signal))
|
|
@@ -61,7 +75,7 @@ const executeCommand = async function (commandArgs, env) {
|
|
|
61
75
|
}
|
|
62
76
|
} catch (error) {
|
|
63
77
|
// no color on these errors as they can be standard errors for things like jest exiting with exitCode 1 for a single failed test.
|
|
64
|
-
if (error.signal !== 'SIGINT') {
|
|
78
|
+
if (error.signal !== 'SIGINT' && error.signal !== 'SIGTERM') {
|
|
65
79
|
if (error.code === 'ENOENT') {
|
|
66
80
|
logger.errornocolor(`Unknown command: ${error.command}`)
|
|
67
81
|
} else if (error.message.includes('Command failed with exit code 1')) {
|
|
@@ -76,6 +90,8 @@ const executeCommand = async function (commandArgs, env) {
|
|
|
76
90
|
} finally {
|
|
77
91
|
// Clean up: Remove the SIGINT handler
|
|
78
92
|
process.removeListener('SIGINT', sigintHandler)
|
|
93
|
+
// Clean up: Remove the SIGTERM handler
|
|
94
|
+
process.removeListener('SIGTERM', sigtermHandler)
|
|
79
95
|
}
|
|
80
96
|
}
|
|
81
97
|
|