summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-01-22 21:04:43 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-01-22 21:04:43 (EST)
commit1b99492c61002f4038ce2cf37b63b26c6b4b1e5b (patch)
treefd9d776efec3f8da03f39a7394355c434ba8788c
parentc057f6d6109f43fd31094d8ac220162d4a6a8274 (diff)
run_cmd(): Return command's exit status
-rw-r--r--src/cmd.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd.sh b/src/cmd.sh
index a42744d..e50b870 100644
--- a/src/cmd.sh
+++ b/src/cmd.sh
@@ -108,6 +108,7 @@ run_cmd()
{
local cmd="${1}"
local cmd_clean=
+ local es=
shift
cmd_clean="$(printf '%s' "${cmd}" | \
@@ -116,6 +117,7 @@ run_cmd()
running_cmd="${cmd}"
running_cmd_clean="${cmd_clean}"
"cmd_${cmd_clean}_main" "${@}"
+ es=${?}
running_cmd=''
running_cmd_clean=''
else
@@ -123,5 +125,5 @@ run_cmd()
return 1
fi
- return 0
+ return ${es}
}