Updates to look for additional local environment variables

This commit is contained in:
2024-03-23 08:55:07 -04:00
parent 090b0fb2f3
commit a2e6d3e825
3 changed files with 7 additions and 10 deletions

View File

@@ -1,4 +1,8 @@
# This needs placed in the ~/.zshenv # 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" export ZDOTDIR="$HOME/.config/zsh"
[ -f "$ZDOTDIR/.zshenv" ] && source "$ZDOTDIR/.zshenv" [ -f "$ZDOTDIR/.zshenv" ] && source "$ZDOTDIR/.zshenv"

View File

@@ -82,13 +82,3 @@ export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
# Tmux-Sessionator path. # Tmux-Sessionator path.
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$LOCAL_REPOS:$HHE_REPOS:$REPOS:$GH_REPOS" 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"

View File

@@ -166,5 +166,8 @@ alias nvim-lazy='NVIM_APPNAME=lazy nvim'
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts"
#------------------------------ local configs ------------------------------ #------------------------------ 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 "$ZDOTDIR/.zshrc-local"
_source_if "$XDG_DATA_HOME/zsh/env.zsh"