Update build.func
This commit is contained in:
parent
714f7a459c
commit
1808acc94c
@ -36,7 +36,7 @@ color() {
|
||||
TAB=" "
|
||||
|
||||
# Icons
|
||||
CM="${TAB}✔️${TAB}${CL}"
|
||||
CM="${TAB}✔️${TAB}"
|
||||
CROSS="${TAB}✖️${TAB}${CL}"
|
||||
INFO="${TAB}💡${TAB}${CL}"
|
||||
OS="${TAB}🖥️${TAB}${CL}"
|
||||
@ -90,7 +90,6 @@ declare -A MSG_INFO_SHOWN
|
||||
SPINNER_ACTIVE=0
|
||||
SPINNER_PID=""
|
||||
SPINNER_MSG=""
|
||||
SPINNER_LINE_PRINTED=0
|
||||
|
||||
trap 'stop_spinner' EXIT INT TERM HUP
|
||||
|
||||
@ -101,16 +100,11 @@ start_spinner() {
|
||||
local interval=0.1
|
||||
|
||||
SPINNER_MSG="$msg"
|
||||
SPINNER_LINE_PRINTED=0
|
||||
printf "\r\e[2K" >&2
|
||||
|
||||
{
|
||||
while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do
|
||||
if [[ "$SPINNER_LINE_PRINTED" -eq 0 ]]; then
|
||||
printf "\r\e[2K%s %b\n" "${frames[spin_i]}" "${YW}${SPINNER_MSG}${CL}" >&2
|
||||
SPINNER_LINE_PRINTED=1
|
||||
else
|
||||
printf "\r\e[1A\e[2K%s %b\n" "${frames[spin_i]}" "${YW}${SPINNER_MSG}${CL}" >&2
|
||||
fi
|
||||
printf "\r\e[2K%s %b" "${frames[spin_i]}" "${YW}${SPINNER_MSG}${CL}" >&2
|
||||
spin_i=$(((spin_i + 1) % ${#frames[@]}))
|
||||
sleep "$interval"
|
||||
done
|
||||
@ -128,7 +122,6 @@ stop_spinner() {
|
||||
wait "$SPINNER_PID" 2>/dev/null || true
|
||||
fi
|
||||
SPINNER_ACTIVE=0
|
||||
SPINNER_LINE_PRINTED=0
|
||||
unset SPINNER_PID
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user