#!/usr/bin/env bash # ============================================================================== # Tiramisu Installer # Tiramisu + GoStorm (Unified Engine) # Target: auto-detected at install time # ============================================================================== set -e # ------------------------------------------------------------------------------ # Color output — standard 8-color + 256-color palette # ------------------------------------------------------------------------------ if [ -t 1 ] && command -v tput >/dev/null 2>&1; then RED=$(tput setaf 1) GREEN=$(tput setaf 2) YELLOW=$(tput setaf 3) BLUE=$(tput setaf 4) BOLD=$(tput bold) NC=$(tput sgr0) _ncolors=$(tput colors 2>/dev/null || echo 8) else RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' BOLD='\033[1m' NC='\033[0m' _ncolors=8 fi # 256-color palette (ANSI 38;5;N — falls back to standard colors) if [ "${_ncolors:-8}" -ge 256 ] 2>/dev/null; then P1=$'\e[38;5;27m' # deep blue (logo line 1) P2=$'\e[38;5;33m' # blue (logo line 2) P3=$'\e[38;5;39m' # blue-cyan (logo line 3) P4=$'\e[38;5;45m' # cyan (logo line 4) P5=$'\e[38;5;51m' # bright cyan (logo line 5/6) PDIM=$'\e[38;5;240m' # dark gray (decorative lines) PSUB=$'\e[38;5;246m' # medium gray (subtitle / payoff) PGRN=$'\e[38;5;82m' # bright green (ok icon) PYLW=$'\e[38;5;220m' # amber (warn icon) PRED=$'\e[38;5;196m' # bright red (err icon) PTEAL=$'\e[38;5;45m' # teal (header accent) PBOX=$'\e[38;5;33m' # blue (summary box) PRST=$'\e[0m' else P1="$BLUE"; P2="$BLUE"; P3="$BLUE"; P4="$BLUE"; P5="$BLUE" PDIM="$NC"; PSUB="$NC"; PGRN="$GREEN"; PYLW="$YELLOW"; PRED="$RED" PTEAL="$BLUE"; PBOX="$BLUE"; PRST="$NC" fi # ------------------------------------------------------------------------------ # Terminal width helpers # ------------------------------------------------------------------------------ get_cols() { tput cols 2>/dev/null || echo 80; } # Full-width horizontal rule: print_hr [color] [char] print_hr() { local col="${1:-$PDIM}" char="${2:-─}" local w; w=$(get_cols) printf "%s " "$col" local _i; for ((_i=0; _i/dev/null || printf '\033[2J\033[H' draw_logo local bar_w=$(( cols - 16 )) local _i # Phase bar — always 3/3, pre-filled to 2/3 local ph_filled=$(( bar_w * 2 / 3 )) local ph_empty=$(( bar_w - ph_filled )) printf " %s" "$P3" for ((_i=0; _i/dev/null || printf '\033[2J\033[H' draw_logo local bar_w=$(( cols - 16 )) local filled=$(( bar_w * step / total )) local empty=$(( bar_w - filled )) printf " %s" "$P3" local _i; for ((_i=0; _i