zsh:conf: Fix HOME fallback

Actually use `_get_config_dir`'s exit code instead of `local`'s (i.e.
always™ zero). This was broken since always.
This commit is contained in:
2025-05-14 18:17:18 +02:00
parent 4914a94ee9
commit 68e1af0328

View File

@@ -95,8 +95,8 @@ conf() {
1="${(*)1%%/#}" 1="${(*)1%%/#}"
# search for program name in XDG_CONFIG_HOME and $HOME # search for program name in XDG_CONFIG_HOME and $HOME
local CONF_DIR="$(_get_config_dir "$1")" local CONF_DIR
if (( $? )); then if ! CONF_DIR="$(_get_config_dir "$1")"; then
printf "\033[1;31mFalling back to $HOME.\n\033[0m" >&2 printf "\033[1;31mFalling back to $HOME.\n\033[0m" >&2
CONF_DIR="$HOME" CONF_DIR="$HOME"
fi fi