Skip to content

Commit

Permalink
stdlib: Set variables in log_error() only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
tmatilai authored and zimbatm committed May 17, 2022
1 parent ef7e49d commit 22923a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib.sh
Expand Up @@ -153,10 +153,10 @@ log_status() {
# log_error "Unable to find specified directory!"

log_error() {
local color_normal="\e[m"
local color_error="\e[38;5;1m"
if [[ -n $DIRENV_LOG_FORMAT ]]; then
local msg=$*
local color_normal="\e[m"
local color_error="\e[38;5;1m"
# shellcheck disable=SC2059,SC1117
printf "${color_error}${DIRENV_LOG_FORMAT}${color_normal}\n" "$msg" >&2
fi
Expand Down

0 comments on commit 22923a8

Please sign in to comment.