summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-11-28 13:03:57 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-11-29 16:11:31 +0000
commit5eafbe6c70910b5662c941f9f7a3c9befc61feea (patch)
treef4b879b857a71420107852df14f7e7ff96753466 /yarns
parent134dcdcbd63f8445f6a7cdd59d11f3b0a1ba1a14 (diff)
downloadmorph-5eafbe6c70910b5662c941f9f7a3c9befc61feea.tar.gz
yarns: Correctly allow run_morph to output stderr on failure
Set -e meant that the stderr could never be re-output, catching the return code and re-outputting was not sufficient.
Diffstat (limited to 'yarns')
-rw-r--r--yarns/morph.shell-lib17
1 files changed, 10 insertions, 7 deletions
diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib
index 2981e6d9..66abd076 100644
--- a/yarns/morph.shell-lib
+++ b/yarns/morph.shell-lib
@@ -30,13 +30,16 @@
run_morph()
{
- "${SRCDIR:-.}"/morph \
- --cachedir-min-space=0 --tempdir-min-space=0 \
- --no-default-config --config "$DATADIR/morph.conf" "$@" \
- 2> "$DATADIR/result-$1"
- local exit_code="$?"
- cat "$DATADIR/result-$1" >&2
- return "$exit_code"
+ {
+ set +e
+ "${SRCDIR:-.}"/morph \
+ --cachedir-min-space=0 --tempdir-min-space=0 \
+ --no-default-config --config "$DATADIR/morph.conf" "$@" \
+ 2> "$DATADIR/result-$1"
+ local exit_code="$?"
+ cat "$DATADIR/result-$1" >&2
+ return "$exit_code"
+ }
}