@dotenvx/dotenvx-ops 0.37.8 → 0.37.9

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 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-ops/compare/v0.37.8...main)
5
+ [Unreleased](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.9...main)
6
+
7
+ ## [0.37.9](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.8...v0.37.9) (2026-04-17)
8
+
9
+ ### Changed
10
+
11
+ * Fix `open` when open command does not exist on user's machine ([#36](https://github.com/dotenvx/dotenvx-ops/pull/36))
6
12
 
7
13
  ## [0.37.8](https://github.com/dotenvx/dotenvx-ops/compare/v0.37.7...v0.37.8) (2026-04-08)
8
14
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.37.8",
2
+ "version": "0.37.9",
3
3
  "name": "@dotenvx/dotenvx-ops",
4
4
  "description": "Secrets for agents–from the creator of `dotenv` and `dotenvx`",
5
5
  "author": "@motdotla",
@@ -1,5 +1,4 @@
1
1
  const fs = require('fs')
2
- const open = require('open')
3
2
 
4
3
  const { logger } = require('@dotenvx/dotenvx')
5
4
  const Session = require('./../../db/session')
@@ -9,6 +8,7 @@ const clipboardy = require('./../../lib/helpers/clipboardy')
9
8
  const confirm = require('./../../lib/helpers/confirm')
10
9
  const formatCode = require('./../../lib/helpers/formatCode')
11
10
  const truncate = require('./../../lib/helpers/truncate')
11
+ const openUrl = require('./../../lib/helpers/openUrl')
12
12
 
13
13
  const LoggedIn = require('./../../lib/services/loggedIn')
14
14
  const Login = require('./../../lib/services/login')
@@ -48,7 +48,7 @@ async function backup () {
48
48
 
49
49
  // optionally allow user to open browser
50
50
  confirm({ message: `press Enter to open [${verificationUri}] and enter code [${formatCode(userCode)}]...` })
51
- .then(answer => answer && open(verificationUriComplete))
51
+ .then(answer => answer && openUrl(verificationUriComplete))
52
52
  .catch(() => {}) // ignore
53
53
 
54
54
  const data = await pollPromise
@@ -1,4 +1,3 @@
1
- const open = require('open')
2
1
  const { logger } = require('@dotenvx/dotenvx')
3
2
  const Session = require('./../../db/session')
4
3
 
@@ -8,6 +7,7 @@ const LoginPoll = require('./../../lib/services/loginPoll')
8
7
  const clipboardy = require('./../../lib/helpers/clipboardy')
9
8
  const createSpinner2 = require('../../lib/helpers/createSpinner2')
10
9
  const formatCode = require('./../../lib/helpers/formatCode')
10
+ const openUrl = require('./../../lib/helpers/openUrl')
11
11
 
12
12
  const FRAMES = ['◐', '◓', '◑', '◒']
13
13
 
@@ -17,6 +17,7 @@ function listenForOpenKey (onOpen) {
17
17
 
18
18
  const canSetRawMode = typeof stdin.setRawMode === 'function'
19
19
  const wasRawMode = Boolean(stdin.isRaw)
20
+ let didHandleOpenChoice = false
20
21
 
21
22
  const cleanup = () => {
22
23
  stdin.off('data', onData)
@@ -35,12 +36,17 @@ function listenForOpenKey (onOpen) {
35
36
  }
36
37
 
37
38
  if (key === '\r' || key === '\n' || lower === 'y') {
38
- cleanup()
39
- Promise.resolve(onOpen()).catch(() => {})
39
+ if (!didHandleOpenChoice) {
40
+ didHandleOpenChoice = true
41
+ Promise.resolve(onOpen()).catch(() => {})
42
+ }
40
43
  return
41
44
  }
42
45
 
43
- if (lower === 'n') cleanup()
46
+ if (lower === 'n') {
47
+ cleanup()
48
+ process.kill(process.pid, 'SIGINT')
49
+ }
44
50
  }
45
51
 
46
52
  if (canSetRawMode) stdin.setRawMode(true)
@@ -78,7 +84,7 @@ async function login () {
78
84
 
79
85
  // begin polling
80
86
  const pollPromise = new LoginPoll(hostname, deviceCode, interval).run()
81
- cleanupOpenKeyListener = listenForOpenKey(() => open(verificationUriComplete))
87
+ cleanupOpenKeyListener = listenForOpenKey(() => openUrl(verificationUriComplete))
82
88
  const data = await pollPromise
83
89
 
84
90
  cleanupOpenKeyListener()
@@ -1,9 +1,8 @@
1
- const _open = require('open')
2
-
3
1
  const { logger } = require('@dotenvx/dotenvx')
4
2
  const Session = require('./../../db/session')
5
3
 
6
4
  const dotenvxProjectId = require('./../../lib/helpers/dotenvxProjectId')
5
+ const openUrl = require('./../../lib/helpers/openUrl')
7
6
 
8
7
  async function open () {
9
8
  // debug opts
@@ -15,7 +14,7 @@ async function open () {
15
14
  const uid = dotenvxProjectId(this.cwd)
16
15
  const url = `${hostname}/go/${uid}`
17
16
 
18
- _open(url)
17
+ await openUrl(url)
19
18
 
20
19
  logger.success(`✔ opened [${url}]`)
21
20
  } catch (error) {
@@ -0,0 +1,7 @@
1
+ const open = require('open')
2
+
3
+ async function openUrl (url) {
4
+ return open(url, { wait: true })
5
+ }
6
+
7
+ module.exports = openUrl