nicer output

This commit is contained in:
olli 2022-12-01 12:35:51 +01:00
parent d15795e0ab
commit 2d0c91979b

View File

@ -6,12 +6,15 @@ function g_runcmd {
if egrep -q -i "warn|error|fail|fatal" $g_tmp/g_runcmd-output if egrep -q -i "warn|error|fail|fatal" $g_tmp/g_runcmd-output
then then
g_echo_warn "$@: $(cat $g_tmp/g_runcmd-output)" g_echo_warn "$@:
$(cat $g_tmp/g_runcmd-output)"
elif [ $g_runcmd_exitcode -eq 0 ] elif [ $g_runcmd_exitcode -eq 0 ]
then then
g_echo_ok "$@: $(cat $g_tmp/g_runcmd-output)" g_echo_ok "$@:
$(cat $g_tmp/g_runcmd-output)"
else else
g_echo_error "$@: $(cat $g_tmp/g_runcmd-output)" g_echo_error "$@:
$(cat $g_tmp/g_runcmd-output)"
fi fi
return $g_runcmd_exitcode return $g_runcmd_exitcode
} }