fixes
This commit is contained in:
parent
1ba68f6461
commit
3a459d9035
@ -75,6 +75,7 @@ error_handler() {
|
|||||||
local command="$2"
|
local command="$2"
|
||||||
local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
|
local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
|
||||||
echo -e "\n$error_message\n"
|
echo -e "\n$error_message\n"
|
||||||
|
[[ -n "${SPINNER_PID:-}" ]] && kill "$SPINNER_PID" &>/dev/null || true
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function displays an informational message with logging support.
|
# This function displays an informational message with logging support.
|
||||||
|
@ -402,6 +402,7 @@ echo_default() {
|
|||||||
|
|
||||||
# This function is called when the user decides to exit the script. It clears the screen and displays an exit message.
|
# This function is called when the user decides to exit the script. It clears the screen and displays an exit message.
|
||||||
exit_script() {
|
exit_script() {
|
||||||
|
[[ -n "${SPINNER_PID:-}" ]] && kill "$SPINNER_PID" &>/dev/null || true
|
||||||
clear
|
clear
|
||||||
echo -e "\n${CROSS}${RD}User exited script${CL}\n"
|
echo -e "\n${CROSS}${RD}User exited script${CL}\n"
|
||||||
exit
|
exit
|
||||||
|
@ -76,6 +76,8 @@ error_handler() {
|
|||||||
local command="$2"
|
local command="$2"
|
||||||
local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
|
local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
|
||||||
echo -e "\n$error_message"
|
echo -e "\n$error_message"
|
||||||
|
[[ -n "${SPINNER_PID:-}" ]] && kill "$SPINNER_PID" &>/dev/null || true
|
||||||
|
|
||||||
if [[ "$line_number" -eq 50 ]]; then
|
if [[ "$line_number" -eq 50 ]]; then
|
||||||
echo -e "The silent function has suppressed the error, run the script with verbose mode enabled, which will provide more detailed output.\n"
|
echo -e "The silent function has suppressed the error, run the script with verbose mode enabled, which will provide more detailed output.\n"
|
||||||
post_update_to_api "failed" "No error message, script ran in silent mode"
|
post_update_to_api "failed" "No error message, script ran in silent mode"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user