„gaboshlib/g_runcmd.bashfunc“ ändern
This commit is contained in:
parent
94cc0f01ef
commit
a5d5169992
@ -1,15 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function g_runcmd {
|
function g_runcmd {
|
||||||
|
set -o pipefail
|
||||||
g_echo "running $@"
|
g_echo "running $@"
|
||||||
$@ 2>&1 | tee $g_tmp/g_runcmd-output
|
$@ 2>&1 | tee $g_tmp/g_runcmd-output
|
||||||
g_runcmd_exitcode=$?
|
g_runcmd_exitcode=$?
|
||||||
|
|
||||||
if [ $g_runcmd_exitcode -eq 0 ]
|
if ! [ $g_runcmd_exitcode -eq 0 ]
|
||||||
then
|
then
|
||||||
g_echo_ok "$@"
|
g_echo_error "# $@
|
||||||
else
|
$(cat $g_tmp/g_runcmd-output)"
|
||||||
g_echo_error "$@"
|
|
||||||
fi
|
fi
|
||||||
return $g_runcmd_exitcode
|
return $g_runcmd_exitcode
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user