From 0c16692a4104bb565539a2feb387505458f665de Mon Sep 17 00:00:00 2001 From: Nathaniel Landau Date: Tue, 10 Mar 2015 22:43:32 -0400 Subject: [PATCH] better handling of hiding user questions from log files --- lib/utils.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/utils.sh b/lib/utils.sh index fe40a57..2771aac 100755 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -49,7 +49,9 @@ function _alert() { #my function fi if [ "${1}" = "input" ]; then local color="${bold}" - printLog="0" # Don't print to $logFile + # Don't print user questions to $logFile + savedvar="${printLog}" + printLog="0" fi if [ "${1}" = "info" ] || [ "${1}" = "notice" ]; then local color="" # Us terminal default color @@ -75,7 +77,7 @@ function warning () { local _message="${@}"; echo "$(_alert warning)"; } function notice () { local _message="${@}"; echo "$(_alert notice)"; } function info () { local _message="${@}"; echo "$(_alert info)"; } function debug () { local _message="${@}"; echo "$(_alert debug)"; } -function success () { local _message="${@}"; echo "$(_alert success)"; } +function success () { local _message="${@}"; echo "$(_alert success)"; printLog="${savedvar}"; } function input() { local _message="${@}"; echo "$(_alert input)"; } function header() { local _message="========== ${@} ========== "; echo "$(_alert header)"; }