From eb7535332975e3b5b3db6823970aea839e34a7e6 Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Fri, 17 Jul 2026 20:10:49 -0500 Subject: tools: ota.sh — a `}` inside a ${1:?...} message truncates the expansion; use a usage() fn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/ota.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/ota.sh b/tools/ota.sh index f03bcc3..0279ab4 100755 --- a/tools/ota.sh +++ b/tools/ota.sh @@ -11,8 +11,10 @@ # tools/ota.sh verify # post-push verification only set -euo pipefail -cmd="${1:?usage: tools/ota.sh {push|verify} [bin]}" -host="${2:?usage: tools/ota.sh {push|verify} [bin]}" +usage() { echo "usage: tools/ota.sh {push|verify} [bin]" >&2; exit 2; } +[ $# -ge 2 ] || usage +cmd="$1" +host="$2" bin="${3:-build/scrypted-viewport.bin}" state_line() { @@ -68,7 +70,6 @@ case "$cmd" in verify ;; *) - echo "usage: tools/ota.sh {push|verify} [bin]" >&2 - exit 2 + usage ;; esac -- cgit v1.2.3