Use consistent bash5 style for conditionals and quoting

This commit is contained in:
David Heinemeier Hansson
2026-02-21 10:18:47 +01:00
parent d2acf3b6ba
commit 7514ae7dcf
113 changed files with 289 additions and 287 deletions
+3 -3
View File
@@ -4,10 +4,10 @@ if ! command -v gum &>/dev/null; then
fi
# Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped)
if [ -e /dev/tty ]; then
if [[ -e /dev/tty ]]; then
TERM_SIZE=$(stty size 2>/dev/null </dev/tty)
if [ -n "$TERM_SIZE" ]; then
if [[ -n $TERM_SIZE ]]; then
export TERM_HEIGHT=$(echo "$TERM_SIZE" | cut -d' ' -f1)
export TERM_WIDTH=$(echo "$TERM_SIZE" | cut -d' ' -f2)
else
@@ -25,7 +25,7 @@ export LOGO_PATH="$OMARCHY_PATH/logo.txt"
export LOGO_WIDTH=$(awk '{ if (length > max) max = length } END { print max+0 }' "$LOGO_PATH" 2>/dev/null || echo 0)
export LOGO_HEIGHT=$(wc -l <"$LOGO_PATH" 2>/dev/null || echo 0)
export PADDING_LEFT=$((($TERM_WIDTH - $LOGO_WIDTH) / 2))
export PADDING_LEFT=$(((TERM_WIDTH - LOGO_WIDTH) / 2))
export PADDING_LEFT_SPACES=$(printf "%*s" $PADDING_LEFT "")
# Tokyo Night theme for gum confirm