„gaboshlib/g_runcmd.bashfunc“ ändern
This commit is contained in:
parent
94cc0f01ef
commit
a5d5169992
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user