Skip to content

Commit a1c012a

Browse files
author
Michael Jennings
committed
nhc-wrapper: In verbose mode, dump command output to stdout as well as the result file.
1 parent aca9cb0 commit a1c012a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nhc-wrapper

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ function nhcwrap_spawn_command() {
220220
vecho "Executing \"$SUBPROG ${ARGLIST[*]}\"" `date "+$NW_DATEFMT"`
221221
# Remove output file so that it will be recreated by bash with ctime of now.
222222
rm -f "$OUTFILE"
223-
"$SUBPROG" "${ARGLIST[@]}" >& "$OUTFILE"
223+
if [[ "$VERBOSE" -eq 1 ]]; then
224+
"$SUBPROG" "${ARGLIST[@]}" 2>&1 | tee "$OUTFILE"
225+
else
226+
"$SUBPROG" "${ARGLIST[@]}" >& "$OUTFILE"
227+
fi
224228
RC=$?
225229
vecho "$SUBPROG returned $RC" `date "+$NW_DATEFMT"`
226230

0 commit comments

Comments
 (0)