tokenrace 0.1.11 → 0.1.12
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/bin/cli.js +2 -24
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -35,32 +35,10 @@ openTerminalHere(CWD)
|
|
|
35
35
|
|
|
36
36
|
// ─── helpers ────────────────────────────────────────────────────────────────
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* Abre el dashboard en modo app (sin barra de navegación ni pestañas).
|
|
40
|
-
* Intenta Chrome en macOS; si no está disponible usa el navegador por defecto.
|
|
41
|
-
*/
|
|
38
|
+
/** Abre el dashboard en el navegador predeterminado del sistema. */
|
|
42
39
|
function openDashboard(port) {
|
|
43
40
|
const url = `http://localhost:${port}`
|
|
44
|
-
|
|
45
|
-
if (process.platform === 'darwin') {
|
|
46
|
-
// macOS: intentar Chrome en modo app (ventana sin chrome de navegador)
|
|
47
|
-
const chrome = spawn(
|
|
48
|
-
'open', ['-na', 'Google Chrome', '--args', `--app=${url}`, '--new-window'],
|
|
49
|
-
{ detached: true, stdio: 'ignore' }
|
|
50
|
-
)
|
|
51
|
-
let fallbackDone = false
|
|
52
|
-
const fallback = () => {
|
|
53
|
-
if (fallbackDone) return
|
|
54
|
-
fallbackDone = true
|
|
55
|
-
// Chrome no disponible — abrir en nueva ventana del navegador por defecto
|
|
56
|
-
open(url, { newInstance: true }).catch(() => open(url).catch(() => {}))
|
|
57
|
-
}
|
|
58
|
-
chrome.on('close', (code) => { if (code !== 0) fallback() })
|
|
59
|
-
chrome.on('error', fallback)
|
|
60
|
-
chrome.unref()
|
|
61
|
-
} else {
|
|
62
|
-
open(url, { newInstance: true }).catch(() => open(url).catch(() => {}))
|
|
63
|
-
}
|
|
41
|
+
open(url).catch(() => {})
|
|
64
42
|
}
|
|
65
43
|
|
|
66
44
|
/**
|