@dotenvx/dotenvx 2.29.0 → 2.30.0

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/package.json +3 -3
  3. package/src/cli/actions/armor/down.js +1 -1
  4. package/src/cli/actions/armor/move.js +1 -1
  5. package/src/cli/actions/armor/open.js +1 -1
  6. package/src/cli/actions/armor/pull.js +1 -1
  7. package/src/cli/actions/armor/push.js +1 -1
  8. package/src/cli/actions/armor/up.js +1 -1
  9. package/src/cli/actions/curl.js +2 -2
  10. package/src/cli/actions/decrypt.js +4 -10
  11. package/src/cli/actions/define.js +1 -1
  12. package/src/cli/actions/del.js +3 -5
  13. package/src/cli/actions/encrypt.js +4 -10
  14. package/src/cli/actions/ext/genexample.js +1 -1
  15. package/src/cli/actions/ext/prebuild.js +1 -1
  16. package/src/cli/actions/ext/scan.js +2 -3
  17. package/src/cli/actions/get.js +4 -7
  18. package/src/cli/actions/keychain/down.js +1 -1
  19. package/src/cli/actions/keychain/pull.js +1 -1
  20. package/src/cli/actions/keychain/push.js +1 -1
  21. package/src/cli/actions/keychain/up.js +1 -1
  22. package/src/cli/actions/keypair.js +3 -3
  23. package/src/cli/actions/lock/down.js +2 -3
  24. package/src/cli/actions/lock/up.js +2 -3
  25. package/src/cli/actions/login.js +2 -2
  26. package/src/cli/actions/logout.js +1 -1
  27. package/src/cli/actions/ls.js +1 -1
  28. package/src/cli/actions/protect.js +4 -1
  29. package/src/cli/actions/protectDocker.js +2 -2
  30. package/src/cli/actions/protectProcess.js +4 -1
  31. package/src/cli/actions/protectStdin.js +1 -0
  32. package/src/cli/actions/run.js +5 -6
  33. package/src/cli/actions/set.js +5 -9
  34. package/src/cli/actions/settings/device.js +2 -2
  35. package/src/cli/actions/settings/hostname.js +2 -2
  36. package/src/cli/actions/settings/off.js +1 -1
  37. package/src/cli/actions/settings/on.js +1 -1
  38. package/src/cli/actions/settings/path.js +2 -2
  39. package/src/cli/actions/settings/token.js +2 -2
  40. package/src/cli/actions/settings/username.js +2 -2
  41. package/src/cli/actions/validate.js +2 -2
  42. package/src/cli/commandAction.js +16 -0
  43. package/src/cli/commands/armor.js +10 -9
  44. package/src/cli/commands/custody.js +6 -4
  45. package/src/cli/commands/ext.js +4 -3
  46. package/src/cli/commands/lock.js +3 -2
  47. package/src/cli/commands/native.js +5 -4
  48. package/src/cli/commands/settings.js +8 -7
  49. package/src/cli/dotenvx.js +14 -10
  50. package/src/lib/events/backends/armor.js +31 -0
  51. package/src/lib/events/background.js +59 -0
  52. package/src/lib/events/catalog.js +14 -0
  53. package/src/lib/events/cli.js +40 -0
  54. package/src/lib/events/delivery.js +89 -0
  55. package/src/lib/events/index.js +73 -0
  56. package/src/lib/events/metadata.js +25 -0
  57. package/src/lib/events/sdk.js +44 -0
  58. package/src/lib/events/worker.js +29 -0
  59. package/src/lib/events/workerEnvironment.js +14 -0
  60. package/src/lib/helpers/checklist.js +8 -3
  61. package/src/lib/helpers/executeCommand.js +12 -1
  62. package/src/lib/helpers/hasPlaintextSecrets.js +2 -6
  63. package/src/lib/main.d.ts +14 -0
  64. package/src/lib/main.js +11 -3
package/CHANGELOG.md CHANGED
@@ -2,7 +2,14 @@
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/v2.29.0...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx/compare/v2.30.0...main)
6
+
7
+ ## [2.23.0](https://github.com/dotenvx/dotenvx/compare/v2.29.0...v2.30.0) (2026-09-22)
8
+
9
+ ### Added
10
+
11
+ * Add support for secrets references as safe from `dotenvx protect` ([#985](https://github.com/dotenvx/dotenvx/pull/985))
12
+ * Add cli audit logging for Armor customers ([#983](https://github.com/dotenvx/dotenvx/pull/983))
6
13
 
7
14
  ## [2.29.0](https://github.com/dotenvx/dotenvx/compare/v2.28.2...v2.29.0) (2026-09-21)
8
15
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.29.0",
2
+ "version": "2.30.0",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a secure dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -45,7 +45,7 @@
45
45
  "scripts": {
46
46
  "standard": "standard",
47
47
  "standard:fix": "standard --fix",
48
- "test": "tap run --test-env=DOTENVX_NO_ARMOR=true --allow-empty-coverage --disable-coverage --timeout=60000",
48
+ "test": "tap run --test-env=DOTENVX_NO_ARMOR=true --allow-empty-coverage --allow-incomplete-coverage --disable-coverage --timeout=60000",
49
49
  "testshell": "shellspec --shell /bin/bash",
50
50
  "release:check": "npm test && npm run testshell",
51
51
  "prerelease": "npm run release:check",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "funding": "https://dotenvx.com",
56
56
  "dependencies": {
57
- "@dotenvx/primitives": "^3.0.2",
57
+ "@dotenvx/primitives": "^3.0.3",
58
58
  "@dotenvx/tooling": "^1.0.3",
59
59
  "global-agent": "^3.0.0",
60
60
  "node-forge": "^1.4.0",
@@ -31,7 +31,7 @@ async function down () {
31
31
  } catch (error) {
32
32
  if (spinner) spinner.stop()
33
33
  logger.error(error.message)
34
- process.exit(1)
34
+ return { exitCode: 1, error }
35
35
  }
36
36
  }
37
37
 
@@ -36,7 +36,7 @@ async function move () {
36
36
  } catch (error) {
37
37
  if (spinner) spinner.stop()
38
38
  logger.error(error.message)
39
- process.exit(1)
39
+ return { exitCode: 1, error }
40
40
  }
41
41
  }
42
42
 
@@ -21,7 +21,7 @@ async function open () {
21
21
  logger.success(`◌ opened (${keyDisplay})`)
22
22
  } catch (error) {
23
23
  logger.error(error.message)
24
- process.exit(1)
24
+ return { exitCode: 1, error }
25
25
  }
26
26
  }
27
27
 
@@ -31,7 +31,7 @@ async function pull () {
31
31
  } catch (error) {
32
32
  if (spinner) spinner.stop()
33
33
  logger.error(error.message)
34
- process.exit(1)
34
+ return { exitCode: 1, error }
35
35
  }
36
36
  }
37
37
 
@@ -31,7 +31,7 @@ async function push () {
31
31
  } catch (error) {
32
32
  if (spinner) spinner.stop()
33
33
  logger.error(error.message)
34
- process.exit(1)
34
+ return { exitCode: 1, error }
35
35
  }
36
36
  }
37
37
 
@@ -31,7 +31,7 @@ async function up () {
31
31
  } catch (error) {
32
32
  if (spinner) spinner.stop()
33
33
  logger.error(error.message)
34
- process.exit(1)
34
+ return { exitCode: 1, error }
35
35
  }
36
36
  }
37
37
 
@@ -58,10 +58,10 @@ async function curl () {
58
58
  const text = await response.body.text()
59
59
  console.log(outputBody(text))
60
60
 
61
- if (response.statusCode >= 400) process.exitCode = 1
61
+ if (response.statusCode >= 400) return { exitCode: 1 }
62
62
  } catch (error) {
63
63
  catchAndLog(error)
64
- process.exit(1)
64
+ return { exitCode: 1, error }
65
65
  }
66
66
  }
67
67
 
@@ -59,11 +59,7 @@ async function decrypt () {
59
59
  }
60
60
  }
61
61
 
62
- if (errorCount > 0) {
63
- process.exit(1)
64
- } else {
65
- process.exit(0) // exit early
66
- }
62
+ return { exitCode: errorCount > 0 ? 1 : 0, errorCount }
67
63
  } else {
68
64
  try {
69
65
  const {
@@ -110,15 +106,13 @@ async function decrypt () {
110
106
  // do nothing - scenario when no .env files found
111
107
  }
112
108
 
113
- if (errorCount > 0) {
114
- process.exit(1)
115
- }
109
+ return { exitCode: errorCount > 0 ? 1 : 0, errorCount }
116
110
  } catch (error) {
117
111
  if (spinner) spinner.stop()
118
112
  catchAndLog(error)
119
- process.exit(1)
113
+ return { exitCode: 1, error }
120
114
  }
121
115
  }
122
116
  }
123
117
 
124
- module.exports = decrypt
118
+ module.exports = require('../../lib/events/cli')('decrypt', decrypt)
@@ -12,6 +12,6 @@ module.exports = function define () {
12
12
  }
13
13
  } catch (error) {
14
14
  catchAndLog(error)
15
- process.exitCode = 1
15
+ return { exitCode: 1, error }
16
16
  }
17
17
  }
@@ -43,14 +43,12 @@ async function del (key) {
43
43
  // do nothing - scenario when no .env files found
44
44
  }
45
45
 
46
- if (errorCount > 0) {
47
- process.exit(1)
48
- }
46
+ return { exitCode: errorCount > 0 ? 1 : 0, errorCount }
49
47
  } catch (error) {
50
48
  if (spinner) spinner.stop()
51
49
  catchAndLog(error)
52
- process.exit(1)
50
+ return { exitCode: 1, error }
53
51
  }
54
52
  }
55
53
 
56
- module.exports = del
54
+ module.exports = require('../../lib/events/cli')('del', del)
@@ -43,11 +43,7 @@ async function encryptAction () {
43
43
  }
44
44
  }
45
45
 
46
- if (errorCount > 0) {
47
- process.exit(1)
48
- } else {
49
- process.exit(0) // exit early
50
- }
46
+ return { exitCode: errorCount > 0 ? 1 : 0, errorCount }
51
47
  }
52
48
 
53
49
  try {
@@ -84,14 +80,12 @@ async function encryptAction () {
84
80
  // do nothing - scenario when no .env files found
85
81
  }
86
82
 
87
- if (errorCount > 0) {
88
- process.exit(1)
89
- }
83
+ return { exitCode: errorCount > 0 ? 1 : 0, errorCount }
90
84
  } catch (error) {
91
85
  if (spinner) spinner.stop()
92
86
  catchAndLog(error)
93
- process.exit(1)
87
+ return { exitCode: 1, error }
94
88
  }
95
89
  }
96
90
 
97
- module.exports = encryptAction
91
+ module.exports = require('../../lib/events/cli')('encrypt', encryptAction)
@@ -29,7 +29,7 @@ function genexample (directory) {
29
29
  }
30
30
  } catch (error) {
31
31
  catchAndLog(error)
32
- process.exit(1)
32
+ return { exitCode: 1, error }
33
33
  }
34
34
  }
35
35
 
@@ -1,5 +1,5 @@
1
1
  const { logger } = require('../../../shared/logger')
2
- const protectDocker = require('../protectDocker')
2
+ const protectDocker = require('../../../lib/events/cli')('protect', require('../protectDocker'))
3
3
 
4
4
  module.exports = function prebuild (directory) {
5
5
  logger.warn('[DEPRECATED] dotenvx prebuild. fix: run [dotenvx protect --docker]')
@@ -14,8 +14,7 @@ function scan () {
14
14
  logger.error('gitleaks: command not found')
15
15
  logger.help('fix: install gitleaks: [brew install gitleaks]')
16
16
  logger.help('fix: other install options: [https://github.com/gitleaks/gitleaks]')
17
- process.exit(1)
18
- return
17
+ return { exitCode: 1, error }
19
18
  }
20
19
 
21
20
  let output = ''
@@ -27,7 +26,7 @@ function scan () {
27
26
  logger.error(chomp(error.stdout.toString()))
28
27
  }
29
28
 
30
- process.exit(1)
29
+ return { exitCode: 1, error }
31
30
  }
32
31
  }
33
32
 
@@ -118,18 +118,15 @@ async function get (key) {
118
118
  }
119
119
  }
120
120
 
121
- if (errorCount > 0) {
122
- process.exit(1)
123
- }
121
+ return { exitCode: errorCount > 0 ? 1 : 0, errorCount }
124
122
  } catch (error) {
125
123
  if (spinner) spinner.stop()
126
124
  if (error.code === 'PROMPT_CANCELLED') {
127
- process.exit(130)
128
- return
125
+ return { exitCode: 130, error }
129
126
  }
130
127
  catchAndLog(error)
131
- process.exit(1)
128
+ return { exitCode: 1, error }
132
129
  }
133
130
  }
134
131
 
135
- module.exports = get
132
+ module.exports = require('../../lib/events/cli')('get', get)
@@ -23,7 +23,7 @@ async function down () {
23
23
  } catch (error) {
24
24
  if (spinner) spinner.stop()
25
25
  logger.error(error.message)
26
- process.exit(1)
26
+ return { exitCode: 1, error }
27
27
  }
28
28
  }
29
29
 
@@ -23,7 +23,7 @@ async function pull () {
23
23
  } catch (error) {
24
24
  if (spinner) spinner.stop()
25
25
  logger.error(error.message)
26
- process.exit(1)
26
+ return { exitCode: 1, error }
27
27
  }
28
28
  }
29
29
 
@@ -23,7 +23,7 @@ async function push () {
23
23
  } catch (error) {
24
24
  if (spinner) spinner.stop()
25
25
  logger.error(error.message)
26
- process.exit(1)
26
+ return { exitCode: 1, error }
27
27
  }
28
28
  }
29
29
 
@@ -23,7 +23,7 @@ async function up () {
23
23
  } catch (error) {
24
24
  if (spinner) spinner.stop()
25
25
  logger.error(error.message)
26
- process.exit(1)
26
+ return { exitCode: 1, error }
27
27
  }
28
28
  }
29
29
 
@@ -65,7 +65,7 @@ async function keypair (key) {
65
65
  } else {
66
66
  if (results === undefined) {
67
67
  console.log('')
68
- process.exit(1)
68
+ return { exitCode: 1 }
69
69
  } else if (options.format === 'colon' && key) {
70
70
  console.log(`${key}:${results}`)
71
71
  } else {
@@ -75,8 +75,8 @@ async function keypair (key) {
75
75
  } catch (error) {
76
76
  if (spinner) spinner.stop()
77
77
  catchAndLog(error)
78
- process.exit(1)
78
+ return { exitCode: 1, error }
79
79
  }
80
80
  }
81
81
 
82
- module.exports = keypair
82
+ module.exports = require('../../lib/events/cli')('keypair', keypair)
@@ -42,12 +42,11 @@ async function down () {
42
42
  }
43
43
  } catch (error) {
44
44
  if (error.code === 'PROMPT_CANCELLED') {
45
- process.exit(130)
46
- return
45
+ return { exitCode: 130, error }
47
46
  }
48
47
 
49
48
  logger.error(error.message)
50
- process.exit(1)
49
+ return { exitCode: 1, error }
51
50
  }
52
51
  }
53
52
 
@@ -50,12 +50,11 @@ async function up () {
50
50
  }
51
51
  } catch (error) {
52
52
  if (error.code === 'PROMPT_CANCELLED') {
53
- process.exit(130)
54
- return
53
+ return { exitCode: 130, error }
55
54
  }
56
55
 
57
56
  logger.error(error.message)
58
- process.exit(1)
57
+ return { exitCode: 1, error }
59
58
  }
60
59
  }
61
60
 
@@ -45,7 +45,7 @@ async function login () {
45
45
  cleanupOpenKeyListener()
46
46
  if (spinner) spinner.stop()
47
47
  logger.success(`◉ logged in (${data.username})`)
48
- process.exit(0)
48
+ return { exitCode: 0 }
49
49
  } catch (error) {
50
50
  cleanupOpenKeyListener()
51
51
  if (spinner) spinner.stop()
@@ -57,7 +57,7 @@ async function login () {
57
57
  if (error.stack) {
58
58
  logger.debug(error.stack)
59
59
  }
60
- process.exit(1)
60
+ return { exitCode: 1, error }
61
61
  }
62
62
  }
63
63
 
@@ -30,7 +30,7 @@ async function logout () {
30
30
  if (error.stack) {
31
31
  logger.debug(error.stack)
32
32
  }
33
- process.exit(1)
33
+ return { exitCode: 1, error }
34
34
  }
35
35
  }
36
36
 
@@ -69,7 +69,7 @@ async function ls (directory) {
69
69
  } catch (error) {
70
70
  if (spinner) spinner.stop()
71
71
  catchAndLog(error)
72
- process.exit(1)
72
+ return { exitCode: 1, error }
73
73
  }
74
74
  }
75
75
 
@@ -6,7 +6,7 @@ const catchAndLog = require('../../lib/helpers/catchAndLog')
6
6
  const settings = require('../../lib/helpers/protectSettings')
7
7
  const createSpinner = require('../../lib/helpers/createSpinner')
8
8
 
9
- module.exports = async function protect (directory) {
9
+ async function protect (directory) {
10
10
  if (this.opts().docker) return require('./protectDocker').call(this, directory)
11
11
  const filterOptions = typeof this.optsWithGlobals === 'function' ? this.optsWithGlobals() : this.opts()
12
12
  if (this.opts().gitProcess) return require('./protectProcess')(filterOptions)
@@ -68,5 +68,8 @@ module.exports = async function protect (directory) {
68
68
  if (spinner) spinner.stop()
69
69
  catchAndLog(error)
70
70
  process.exitCode = 1
71
+ return { error }
71
72
  }
72
73
  }
74
+
75
+ module.exports = require('../../lib/events/cli')('protect', protect)
@@ -3,7 +3,7 @@ const { logger } = require('../../shared/logger')
3
3
  const Prebuild = require('../../lib/services/prebuild')
4
4
  const catchAndLog = require('../../lib/helpers/catchAndLog')
5
5
 
6
- function protectDocker (directory) {
6
+ async function protectDocker (directory) {
7
7
  // debug args
8
8
  logger.debug(`directory: ${directory}`)
9
9
 
@@ -23,7 +23,7 @@ function protectDocker (directory) {
23
23
  logger.success(successMessage)
24
24
  } catch (error) {
25
25
  catchAndLog(error)
26
- process.exit(1)
26
+ return { exitCode: 1, error }
27
27
  }
28
28
  }
29
29
 
@@ -27,6 +27,7 @@ module.exports = async function protectProcess (options = {}) {
27
27
  let spinner
28
28
  let started = false
29
29
  let failed = false
30
+ let errorCount = 0
30
31
  let activeRequest = false
31
32
  let reported = false
32
33
  const checkedFiles = new Set()
@@ -78,7 +79,7 @@ module.exports = async function protectProcess (options = {}) {
78
79
  await packet(null)
79
80
  while (true) {
80
81
  const headers = await list(true)
81
- if (headers === null) return
82
+ if (headers === null) return { errorCount }
82
83
  activeRequest = true
83
84
  const fields = new Map(lines(headers).map(line => {
84
85
  const index = line.indexOf('=')
@@ -94,6 +95,7 @@ module.exports = async function protectProcess (options = {}) {
94
95
  // Checkout must remain a byte-for-byte passthrough, even for existing plaintext history.
95
96
  if (command === 'clean' && !check(fields.get('pathname'), content, stop)) {
96
97
  failed = true
98
+ errorCount++
97
99
  await packet('status=error\n')
98
100
  await packet(null)
99
101
  activeRequest = false
@@ -116,6 +118,7 @@ module.exports = async function protectProcess (options = {}) {
116
118
  logger.error('Git protection filter protocol failed')
117
119
  process.exitCode = 1
118
120
  process.stdin.destroy()
121
+ return { error: { code: 'GIT_FILTER_PROTOCOL_FAILED' } }
119
122
  } finally {
120
123
  finish()
121
124
  process.removeListener('exit', onExit)
@@ -53,6 +53,7 @@ async function protectStdin (filepath, options = {}) {
53
53
  stop()
54
54
  logger.error(error.message)
55
55
  process.exitCode = 1
56
+ return { error }
56
57
  } finally {
57
58
  stop()
58
59
  }
@@ -95,7 +95,7 @@ async function run () {
95
95
  logger.error(`ambiguous command due to missing '--' separator. try [dotenvx run -f ${realExample} -- yourcommand]`)
96
96
  }
97
97
 
98
- process.exit(1)
98
+ return { exitCode: 1 }
99
99
  }
100
100
 
101
101
  try {
@@ -214,18 +214,17 @@ async function run () {
214
214
  if (closeProxy) await closeProxy()
215
215
  if (spinner) spinner.stop()
216
216
  if (error.code === 'PROMPT_CANCELLED') {
217
- process.exit(130)
218
- return
217
+ return { exitCode: 130, error }
219
218
  }
220
219
  catchAndLog(error)
221
- process.exit(1)
220
+ return { exitCode: 1, error }
222
221
  }
223
222
 
224
223
  try {
225
- await executeCommand(commandArgs, commandEnv, sensitiveValues, closeProxy)
224
+ return await executeCommand(commandArgs, commandEnv, sensitiveValues, closeProxy)
226
225
  } finally {
227
226
  if (closeProxy) await closeProxy()
228
227
  }
229
228
  }
230
229
 
231
- module.exports = run
230
+ module.exports = require('../../lib/events/cli')('run', run)
@@ -25,8 +25,7 @@ async function set (key, value) {
25
25
  if (value === undefined || value === null) {
26
26
  if (!process.stdin.isTTY) {
27
27
  catchAndLog(new Errors({ key }).missingValue())
28
- process.exit(1)
29
- return
28
+ return { exitCode: 1 }
30
29
  }
31
30
 
32
31
  try {
@@ -40,8 +39,7 @@ async function set (key, value) {
40
39
  })
41
40
  } catch (error) {
42
41
  if (error.code === 'PROMPT_CANCELLED') {
43
- process.exit(130)
44
- return
42
+ return { exitCode: 130, error }
45
43
  }
46
44
 
47
45
  throw error
@@ -127,14 +125,12 @@ async function set (key, value) {
127
125
  // // do nothing
128
126
  // }
129
127
 
130
- if (errorCount > 0) {
131
- process.exit(1)
132
- }
128
+ return { exitCode: errorCount > 0 ? 1 : 0, errorCount }
133
129
  } catch (error) {
134
130
  if (spinner) spinner.stop()
135
131
  catchAndLog(error)
136
- process.exit(1)
132
+ return { exitCode: 1, error }
137
133
  }
138
134
  }
139
135
 
140
- module.exports = set
136
+ module.exports = require('../../lib/events/cli')('set', set)
@@ -13,10 +13,10 @@ function device () {
13
13
  }
14
14
 
15
15
  logger.error('missing device. Try generating one with [dotenvx armor login].')
16
- process.exit(1)
16
+ return { exitCode: 1 }
17
17
  } catch (error) {
18
18
  logger.error(error.message)
19
- process.exit(1)
19
+ return { exitCode: 1, error }
20
20
  }
21
21
  }
22
22
 
@@ -10,10 +10,10 @@ function hostname () {
10
10
  }
11
11
 
12
12
  logger.error('missing hostname. Try running [dotenvx armor login].')
13
- process.exit(1)
13
+ return { exitCode: 1 }
14
14
  } catch (error) {
15
15
  logger.error(error.message)
16
- process.exit(1)
16
+ return { exitCode: 1, error }
17
17
  }
18
18
  }
19
19
 
@@ -7,7 +7,7 @@ function off () {
7
7
  logger.success('✔ armor: off')
8
8
  } catch (error) {
9
9
  logger.error(error.message)
10
- process.exit(1)
10
+ return { exitCode: 1, error }
11
11
  }
12
12
  }
13
13
 
@@ -7,7 +7,7 @@ function on () {
7
7
  logger.success('✔ armor: on')
8
8
  } catch (error) {
9
9
  logger.error(error.message)
10
- process.exit(1)
10
+ return { exitCode: 1, error }
11
11
  }
12
12
  }
13
13
 
@@ -10,10 +10,10 @@ function path () {
10
10
  }
11
11
 
12
12
  logger.error('missing path. Try running [dotenvx armor login].')
13
- process.exit(1)
13
+ return { exitCode: 1 }
14
14
  } catch (error) {
15
15
  logger.error(error.message)
16
- process.exit(1)
16
+ return { exitCode: 1, error }
17
17
  }
18
18
  }
19
19
 
@@ -13,10 +13,10 @@ function token () {
13
13
  }
14
14
 
15
15
  logger.error('missing token. Try generating one with [dotenvx armor login].')
16
- process.exit(1)
16
+ return { exitCode: 1 }
17
17
  } catch (error) {
18
18
  logger.error(error.message)
19
- process.exit(1)
19
+ return { exitCode: 1, error }
20
20
  }
21
21
  }
22
22
 
@@ -10,10 +10,10 @@ function username () {
10
10
  }
11
11
 
12
12
  logger.error('login required. Try running [dotenvx armor login].')
13
- process.exit(1)
13
+ return { exitCode: 1 }
14
14
  } catch (error) {
15
15
  logger.error(error.message)
16
- process.exit(1)
16
+ return { exitCode: 1, error }
17
17
  }
18
18
  }
19
19