From e3d650ae8b3d8b2c97d8998ddbb8b757b3a47429 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 15 May 2025 15:21:39 +0200 Subject: [PATCH] testing spinner alpine --- misc/core.func | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/misc/core.func b/misc/core.func index 24c41781..77daea39 100644 --- a/misc/core.func +++ b/misc/core.func @@ -257,27 +257,18 @@ start_spinner() { SPINNER_MSG="$msg" SPINNER_ACTIVE=1 - if [[ "${CORE_OS:-}" == "alpine" ]]; then - { - while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do - printf "\r\e[2K⠋ %b" "$SPINNER_MSG" >&2 - sleep "$interval" - done - } & - else - { - while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do - if [[ -t 2 ]]; then - printf "\r\e[2K%s %b" "${TAB}${spinner_frames[spin_i]}${TAB}" "${YW}${SPINNER_MSG}${CL}" >&2 - else - printf "%s...\n" "$SPINNER_MSG" >&2 - break - fi - spin_i=$(((spin_i + 1) % ${#spinner_frames[@]})) - sleep "$interval" - done - } & - fi + { + while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do + if [[ -t 2 ]]; then + printf "\r\e[2K%s %b" "${TAB}${spinner_frames[spin_i]}${TAB}" "${YW}${SPINNER_MSG}${CL}" >&2 + else + printf "%s...\n" "$SPINNER_MSG" >&2 + break + fi + spin_i=$(((spin_i + 1) % ${#spinner_frames[@]})) + sleep "$interval" + done + } & local pid=$! if kill -0 "$pid" 2>/dev/null; then