Skip to content

Commit e411089

Browse files
authored
Merge pull request #265 from tegonal/bugfix/withCustomOutputInput-early-exit
capture exit code of callback and return at the end
2 parents 1a87e46 + 7baa986 commit e411089

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utility/io.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ function withCustomOutputInput() {
7676
# same same if $withCustomOutputInput_fun should fail/exit, we don't setup a trap, the system should clean it up
7777
rm "$withCustomOutputInput_tmpFile" || true
7878

79-
$withCustomOutputInput_fun "$@"
79+
local exitCode=0
80+
$withCustomOutputInput_fun "$@" || exitCode=$?
8081

8182
eval "exec ${withCustomOutputInput_outputNr}>&-"
8283
eval "exec ${withCustomOutputInput_inputNr}<&-"
84+
return "$exitCode"
8385
}
8486

8587
function deleteDirChmod777() {

0 commit comments

Comments
 (0)