Add step-levels and check_util function

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-12-13 16:49:43 +01:00
parent 9e38637570
commit c849ae1435
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -4,6 +4,10 @@ COLOR_CYAN="\033[0;36m"
COLOR_YELLOW="\033[0;33m"
COLOR_PLAIN="\033[0m"
function check_util() {
which ${1} >/dev/null 2>&1 || fail "Missing ${1} util"
}
function error() {
echo -e "${COLOR_RED}$@${COLOR_PLAIN}" >&2
}
@ -22,7 +26,7 @@ function info() {
}
function step() {
info "[$(date +%H:%M:%S)] $@"
info "[$(date +%H:%M:%S)] $(printf "%${script_level:-0}s" '' | tr ' ' '+')$@"
}
function success() {