Update alpine-install.func

revert add spinner
pull/2345/head
tteckster 2024-01-07 09:41:22 -05:00 committed by GitHub
parent 8b7820b03a
commit e27191e607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 23 deletions

View File

@ -34,8 +34,6 @@ catch_errors() {
} }
error_handler() { error_handler() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
printf "\e[?25h"
local exit_code="$?" local exit_code="$?"
local line_number="$1" local line_number="$1"
local command="$2" local command="$2"
@ -43,37 +41,17 @@ error_handler() {
echo -e "\n$error_message\n" echo -e "\n$error_message\n"
} }
# This function displays a spinner.
spinner() {
printf "\e[?25l"
spinner="/-\\|/-\\|"
spin_i=0
while true; do
printf "\b%s" "${spinner:spin_i++%${#spinner}:1}"
sleep 0.1
done
}
# This function displays an informational message with a yellow color.
msg_info() { msg_info() {
local msg="$1" local msg="$1"
echo -ne " ${HOLD} ${YW}${msg} " echo -ne " ${HOLD} ${YW}${msg}..."
spinner &
SPINNER_PID=$!
} }
# This function displays a success message with a green color.
msg_ok() { msg_ok() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
printf "\e[?25h"
local msg="$1" local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}" echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
} }
# This function displays a error message with a red color.
msg_error() { msg_error() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
printf "\e[?25h"
local msg="$1" local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}" echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
} }