Commit 5f89c4f
authored
fix(connect): WS port preflight aborts under set -e when port is free (#70)
`preflight_ws_port` called `port_in_use "$p"; local rc=$?` as a bare
statement. Under `set -euo pipefail`, `port_in_use` returns non-zero
precisely when the port is FREE (its `grep -q` finds no listener), so
`set -e` aborts the whole installer before `rc` is ever read — the
common, healthy case silently kills the run right after the `ss | grep`.
Capture the status in an errexit-exempt context so the rc=2 (no
ss/netstat) / rc!=0 (free) / rc=0 (in use) branches work as intended:
local rc=0; port_in_use "$p" || rc=$?
Applied identically to all three env installers (mainnet-beta/devnet/testnet).1 parent 806ccd6 commit 5f89c4f
3 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
| 430 | + | |
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
0 commit comments