diff --git a/build b/build index 5968bb09c..60b021ee2 100755 --- a/build +++ b/build @@ -97,6 +97,7 @@ readonly RUN_ARGS="$@" echo " --short-output - reduce output by not printing skipped subtargets" echo " --logviewer-command - use this command for the log viewer" echo " --no-colors - disable colorized output, useful when logging to a file" + echo " --wait-for-logviewer - wait until after logviewer completes, e.g. for echo" echo " available Python versions: 2, 3" echo " available clang versions: 3.4, git" echo " available gcc versions:" @@ -283,6 +284,7 @@ while [[ $# > 0 ]]; do COLOR_PKG_NAME="" COLOR_STATUS="" ;; + --wait-for-logviewer) LOGVIEWER_WAIT=yes ;; *) die "bad command line: \"$1\". terminate." ;; diff --git a/library/config.sh b/library/config.sh index ddef1264a..117130c1b 100644 --- a/library/config.sh +++ b/library/config.sh @@ -193,6 +193,7 @@ echo "done" # ************************************************************************** LOGVIEWER= +LOGVIEWER_WAIT=no func_find_logviewer \ LOGVIEWERS[@] \ diff --git a/library/functions.sh b/library/functions.sh index 3ee67b419..a4cee7cf2 100644 --- a/library/functions.sh +++ b/library/functions.sh @@ -96,13 +96,20 @@ function die { # $2 - exit code local _retcode=1 [[ -n $2 ]] && _retcode=$2 - echo $1 + echo + >&2 echo $1 exit $_retcode } function func_show_log { # $1 - log file - [[ $SHOW_LOG_ON_ERROR == yes ]] && $LOGVIEWER $1 & + [[ $SHOW_LOG_ON_ERROR == yes ]] && { + [[ $LOGVIEWER_WAIT == yes ]] && { + $LOGVIEWER $1 + } || { + $LOGVIEWER $1 & + } + } } # **************************************************************************