Fix spotread exit code aborting scan under pipefail
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -18,7 +18,9 @@ if ! command -v spotread >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
echo "Checking for i1Pro..."
|
||||
if spotread -? 2>&1 | grep -q '\*\* No ports found \*\*'; then
|
||||
# spotread -? exits 1 (usage), so capture output rather than piping under pipefail.
|
||||
PORTS="$(spotread -? 2>&1 || true)"
|
||||
if grep -q '\*\* No ports found \*\*' <<<"$PORTS"; then
|
||||
echo "Error: No USB instrument detected." >&2
|
||||
echo " 1. Connect the i1Pro 2 via USB" >&2
|
||||
echo " 2. Run: sudo ./setup-udev.sh" >&2
|
||||
|
||||
Reference in New Issue
Block a user