Files
dbtool-cli-v1/scripts/tui/smoke-tty.sh
Paperclip CTO a28dab4cd9
Some checks failed
release-smoke / macos-13 / x86_64-apple-darwin (push) Has been cancelled
release-smoke / ubuntu-latest / x86_64-unknown-linux-gnu (push) Has been cancelled
release-smoke / windows-latest / x86_64-pc-windows-msvc (push) Has been cancelled
feat(usable): package gui-host validation snapshot
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-31 10:21:36 +00:00

34 lines
787 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -lt 1 ] || [ "$#" -gt 4 ]; then
echo "usage: scripts/tui/smoke-tty.sh <binary-path> [rows] [cols] [log-path]" >&2
exit 2
fi
if ! command -v script >/dev/null 2>&1; then
echo "error: \`script\` command is required for TTY smoke." >&2
exit 3
fi
binary_path="$1"
rows="${2:-40}"
cols="${3:-120}"
log_path="${4:-/tmp/dbtool-tui-smoke.log}"
if [ ! -x "$binary_path" ]; then
echo "error: binary is not executable: $binary_path" >&2
exit 4
fi
command_string="$(printf 'stty rows %s cols %s; "%s"' "$rows" "$cols" "$binary_path")"
rm -f "$log_path"
printf 'q' | script -qec "$command_string" "$log_path" >/dev/null
echo "TTY smoke passed."
echo "binary: $binary_path"
echo "rows: $rows"
echo "cols: $cols"
echo "log: $log_path"