mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-09-21 10:27:09 +00:00
lib/utils: Simplify "_omb_log_die"
This commit is contained in:
parent
29bcd14fa3
commit
71b2d2ee52
11
lib/utils.sh
11
lib/utils.sh
@ -242,16 +242,7 @@ _omb_util_command_exists _omb_log_note ||
|
||||
_omb_util_command_exists _omb_log_info ||
|
||||
function _omb_log_info { printf "INFO: %s\n" "$1"; }
|
||||
_omb_util_command_exists _omb_log_die ||
|
||||
function _omb_log_die {
|
||||
local status=$1
|
||||
case $status in
|
||||
1) printf 'FATAL: %s\n' "$2"
|
||||
exit "$status" ;;
|
||||
*) printf 'FATAL: Syntax error%s\n%s\n' "${FUNCNAME:+ in $FUNCNAME}" "$2"
|
||||
((status)) && printf 'FATAL: %s\n' "$status"
|
||||
return "$status" ;;
|
||||
esac
|
||||
}
|
||||
function _omb_log_die { printf 'FATAL: %s\n' "$2"; exit "$1"; }
|
||||
|
||||
#
|
||||
# USAGE FOR SEEKING CONFIRMATION
|
||||
|
Loading…
Reference in New Issue
Block a user