From c8ccdbaf3b18d06a9406782521cbb66551e15a76 Mon Sep 17 00:00:00 2001 From: okseby Date: Fri, 27 Feb 2026 12:22:37 -0500 Subject: [PATCH] add docker install anim --- install-wings.sh | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/install-wings.sh b/install-wings.sh index 0d5c542..b85e935 100644 --- a/install-wings.sh +++ b/install-wings.sh @@ -12,7 +12,6 @@ set -euo pipefail TTY="/dev/tty" BOLD="\033[1m" -DIM="\033[2m" GREEN="\033[32m" YELLOW="\033[33m" RED="\033[31m" @@ -66,6 +65,40 @@ apt_install() { $SUDO apt-get install -y "$@" >/dev/null 2>&1 } +######################################## +# Spinner (writes to /dev/tty so curl|bash stays safe) +######################################## +run_with_spinner() { + local label="$1"; shift + + # Run the provided command in the background + ("$@") & + local pid=$! + + local spin='|/-\' + local i=0 + + # Hide cursor + printf "\033[?25l" >"$TTY" || true + + # Spinner loop + while kill -0 "$pid" 2>/dev/null; do + i=$(( (i + 1) % 4 )) + printf "\r${BLUE}${BOLD}..${RESET} %s %s" "${spin:$i:1}" "$label" >"$TTY" + sleep 0.12 + done + + # Wait for completion + capture exit status + wait "$pid" + local rc=$? + + # Clear spinner line + show cursor + printf "\r\033[K" >"$TTY" + printf "\033[?25h" >"$TTY" || true + + return "$rc" +} + ######################################## # SSL config updater ######################################## @@ -143,7 +176,8 @@ else section "Installing Docker (quiet mode)" apt_install ca-certificates curl - if curl -fsSL https://get.docker.com/ | CHANNEL=stable $SUDO bash >/dev/null 2>&1; then + # Quiet install + spinner so users know it's working + if run_with_spinner "Installing Docker..." bash -c "curl -fsSL https://get.docker.com/ | CHANNEL=stable ${SUDO:-} bash >/dev/null 2>&1"; then say "Docker installed successfully" say "$(docker --version)" else