Fix warnings not being printed

This commit is contained in:
Joaquín Triñanes 2025-04-16 11:58:53 +02:00
parent 69a5b2175e
commit 374b328270
No known key found for this signature in database
GPG key ID: 6E1446DD451C6BAF

View file

@ -15,16 +15,18 @@ _nix_direnv_info() {
} }
_nix_direnv_warning() { _nix_direnv_warning() {
if [[ -n $DIRENV_LOG_FORMAT ]]; then local msg=$*
local msg=$* color_normal='' color_warning='' local color_normal=""
if [[ -t 2 ]]; then local color_warning=""
color_normal="\e[m"
color_warning="\e[33m" if [[ -t 2 ]]; then
fi color_normal="\e[m"
# shellcheck disable=SC2059 color_warning="\e[33m"
printf "${color_warning}${DIRENV_LOG_FORMAT}${color_normal}\n" \
"${_NIX_DIRENV_LOG_PREFIX}${msg}" >&2
fi fi
printf "%b" "$color_warning"
log_status "${_NIX_DIRENV_LOG_PREFIX}${msg}"
printf "%b" "$color_normal"
} }
_nix_direnv_error() { log_error "${_NIX_DIRENV_LOG_PREFIX}$*"; } _nix_direnv_error() { log_error "${_NIX_DIRENV_LOG_PREFIX}$*"; }