Update core.func

This commit is contained in:
CanbiZ 2025-05-15 14:12:29 +02:00
parent f259e06a97
commit cae912d5ec

View File

@ -223,18 +223,12 @@ __curl_err_handler() {
[[ -n "$curl_msg" ]] && printf "%s\n" "$curl_msg" >&2 [[ -n "$curl_msg" ]] && printf "%s\n" "$curl_msg" >&2
exit 1 exit 1
} }
detect_os_type() { detect_os_type() {
if [[ -f /etc/os-release ]]; then if [[ -n "${var_os:-}" ]]; then
local os_id CORE_OS="$var_os"
os_id=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '"') echo $CORE_OS
case "$os_id" in
alpine) var_os="alpine" ;;
debian | ubuntu) var_os="debian" ;;
*) var_os="other" ;;
esac
else else
var_os="unknown" CORE_OS="debian"
fi fi
} }
@ -256,7 +250,7 @@ start_spinner() {
SPINNER_MSG="$msg" SPINNER_MSG="$msg"
SPINNER_ACTIVE=1 SPINNER_ACTIVE=1
if [[ "$var_os" == "alpine" ]]; then if [[ "$CORE_OS" == "alpine" ]]; then
{ {
while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do while [[ "$SPINNER_ACTIVE" -eq 1 ]]; do
printf "\r\e[2K⠋ %b" "$SPINNER_MSG" >&2 printf "\r\e[2K⠋ %b" "$SPINNER_MSG" >&2