From 68e1af0328071b5fcff8ae884745201809f2de7e Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 14 May 2025 18:17:18 +0200 Subject: [PATCH] zsh:conf: Fix HOME fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Actually use `_get_config_dir`'s exit code instead of `local`'s (i.e. always™ zero). This was broken since always. --- .config/zsh/zshrc.d/40-functions.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index 84f51c4..372f69a 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -95,8 +95,8 @@ conf() { 1="${(*)1%%/#}" # search for program name in XDG_CONFIG_HOME and $HOME - local CONF_DIR="$(_get_config_dir "$1")" - if (( $? )); then + local CONF_DIR + if ! CONF_DIR="$(_get_config_dir "$1")"; then printf "\033[1;31mFalling back to $HOME.\n\033[0m" >&2 CONF_DIR="$HOME" fi