add docker install anim

This commit is contained in:
Sebastian Cabrera 2026-02-27 12:22:37 -05:00
parent 2d36f66087
commit c8ccdbaf3b
Signed by: okseby
GPG key ID: 37783FE2501AE402

View file

@ -12,7 +12,6 @@ set -euo pipefail
TTY="/dev/tty" TTY="/dev/tty"
BOLD="\033[1m" BOLD="\033[1m"
DIM="\033[2m"
GREEN="\033[32m" GREEN="\033[32m"
YELLOW="\033[33m" YELLOW="\033[33m"
RED="\033[31m" RED="\033[31m"
@ -66,6 +65,40 @@ apt_install() {
$SUDO apt-get install -y "$@" >/dev/null 2>&1 $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 # SSL config updater
######################################## ########################################
@ -143,7 +176,8 @@ else
section "Installing Docker (quiet mode)" section "Installing Docker (quiet mode)"
apt_install ca-certificates curl 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 installed successfully"
say "$(docker --version)" say "$(docker --version)"
else else