From a5d5169992710b1000f858cf721f9ccfcfaa2cd7 Mon Sep 17 00:00:00 2001 From: olli Date: Thu, 1 Dec 2022 15:01:42 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9Egaboshlib/g=5Fruncmd.bashfunc=E2=80=9C?= =?UTF-8?q?=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gaboshlib/g_runcmd.bashfunc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gaboshlib/g_runcmd.bashfunc b/gaboshlib/g_runcmd.bashfunc index 6479f1e..10a6310 100644 --- a/gaboshlib/g_runcmd.bashfunc +++ b/gaboshlib/g_runcmd.bashfunc @@ -1,15 +1,15 @@ #!/bin/bash function g_runcmd { + set -o pipefail g_echo "running $@" - $@ 2>&1 | tee $g_tmp/g_runcmd-output + $@ 2>&1 | tee $g_tmp/g_runcmd-output g_runcmd_exitcode=$? - if [ $g_runcmd_exitcode -eq 0 ] + if ! [ $g_runcmd_exitcode -eq 0 ] then - g_echo_ok "$@" - else - g_echo_error "$@" + g_echo_error "# $@ +$(cat $g_tmp/g_runcmd-output)" fi return $g_runcmd_exitcode }