Skip to content

Commit

Permalink
update debug logic slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Kazmier committed Jun 1, 2021
1 parent 50b3aa3 commit e7ed17f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ else
fi;
export TFENV_ROOT;

# Only reset DEBUG if TFENV_DEBUG is set, and DEBUG is unset or already a number
if [ "${TFENV_DEBUG:-0}" -gt 0 ] && [[ "${DEBUG:-0}" =~ ^[0-9]+$ ]]; then
[ "${DEBUG:-0}" -gt "${TFENV_DEBUG:-0}" ] || export DEBUG="${TFENV_DEBUG:-0}";
if [ "${TFENV_DEBUG:-0}" -gt 0 ]; then
# Only reset DEBUG if TFENV_DEBUG is set, and DEBUG is unset or already a number
if [[ "${DEBUG:-0}" =~ ^[0-9]+$ ]] && [ "${DEBUG:-0}" -gt "${TFENV_DEBUG:-0}" ]; then
export DEBUG="${TFENV_DEBUG:-0}";
fi;
if [[ "${TFENV_DEBUG}" -gt 2 ]]; then
export PS4='+ [${BASH_SOURCE##*/}:${LINENO}] ';
set -x;
Expand Down

0 comments on commit e7ed17f

Please sign in to comment.