From a2e6d3e82563e052d15981966db689e32bc226e8 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Sat, 23 Mar 2024 08:55:07 -0400 Subject: [PATCH] Updates to look for additional local environment variables --- zsh/.zshenv | 4 ++++ zsh/config/.zshenv | 10 ---------- zsh/config/.zshrc | 3 +++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/zsh/.zshenv b/zsh/.zshenv index 695afbb..d81324a 100755 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -1,4 +1,8 @@ # This needs placed in the ~/.zshenv +# +# This sources general default environment variables from `ZDOTDIR`, local overrides may be stored +# in `$XDG_DATA_HOME/zsh/env.zsh`. The `ZDOTDIR/.zshrc-local` is a legacy file location that I used, +# but should be removed when all my machines are updated to use the local overrides file. export ZDOTDIR="$HOME/.config/zsh" [ -f "$ZDOTDIR/.zshenv" ] && source "$ZDOTDIR/.zshenv" diff --git a/zsh/config/.zshenv b/zsh/config/.zshenv index 3b63cf2..5992cb5 100755 --- a/zsh/config/.zshenv +++ b/zsh/config/.zshenv @@ -82,13 +82,3 @@ export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible" # Tmux-Sessionator path. export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$LOCAL_REPOS:$HHE_REPOS:$REPOS:$GH_REPOS" -function _source_files_if_found { - for file in "$@"; do - [ -x "$file" ] && source "$file" - done -} - -_source_files_if_found \ - "$ZDOTDIR/.zshrc-local" \ - "$XDG_DATA_HOME/env.zsh" \ - "$XDG_DATA_HOME/env" diff --git a/zsh/config/.zshrc b/zsh/config/.zshrc index 4e8352c..35f5c77 100755 --- a/zsh/config/.zshrc +++ b/zsh/config/.zshrc @@ -166,5 +166,8 @@ alias nvim-lazy='NVIM_APPNAME=lazy nvim' alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" #------------------------------ local configs ------------------------------ +# TODO: The .zshrc-local is a legacy location and should be removed once my machines are +# use the new location in XDG_DATA_HOME. _source_if "$ZDOTDIR/.zshrc-local" +_source_if "$XDG_DATA_HOME/zsh/env.zsh"