Update core.func

This commit is contained in:
CanbiZ 2025-05-09 15:44:24 +02:00
parent 7f3d371262
commit 2d9c8e6136

View File

@ -21,7 +21,7 @@ load_functions() {
formatting
icons
default_vars
silent
set_std_mode
# add more
}
@ -96,16 +96,21 @@ if [ -v VERBOSE ]; then
else
echo "DEBUG: VERBOSE was not defined, applying default"
fi
VERBOSE="${1:-no}"
silent() {
echo "DEBUG: VERBOSE: '$VERBOSE'"
if [ "$VERBOSE" = "no" ]; then
"$@" >/dev/null 2>&1 || return 1
set_std_mode() {
if [ "$VERBOSE" = "yes" ]; then
STD=""
else
"$@" || return 1
STD="silent"
fi
}
# Silent execution function
silent() {
"$@" >/dev/null 2>&1
}
# ------------------------------------------------------------------------------
# Performs a curl request with retry logic and inline feedback.
# ------------------------------------------------------------------------------