Commit 5d1ea13b authored by gregor herrmann's avatar gregor herrmann

posix-lib.sh: run the pipe/tee magic only for subcommands

where it's actually used later on.
parent 9be17176
......@@ -16,6 +16,18 @@
dpt() {
local REAL TMP ES
REAL=`command which dpt`
ES=0
case "$1" in
cd|co|checkout)
# continue below
;;
*)
$REAL "$@" || ES=$?
return $ES
;;
esac
TMP=`mktemp -d --suffix=.dpt`
if [ -n "${BASH:-}" ]; then
trap "command rm -rf '$TMP'" RETURN
......@@ -27,7 +39,6 @@ dpt() {
set +m
tee "$TMP/out" < "$TMP/pipe" &
)
ES=0
$REAL "$@" > "$TMP/pipe" || ES=$?
[ -e "$TMP/out" ] || return $ES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment