refactor(shell): collapse managed tree back into stubs
Drop ~/.config/zsh/{env,interactive,login} modules. PATH and local.zsh
live in .zshenv; interactive UX is a single .zshrc again. Deploy only
installs the three stubs and removes obsolete trees/examples.
This commit is contained in:
@@ -1,20 +1,24 @@
|
||||
# easyzsh stub: every zsh loads this. Keep it thin; logic lives under ~/.config/zsh/.
|
||||
# Always-on env for every zsh (interactive, login, agents, zsh -c).
|
||||
# Machine-local overrides: ~/.config/zsh/local.zsh (never overwritten by deploy).
|
||||
EASYZSH_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/zsh"
|
||||
|
||||
if [[ -d "$EASYZSH_HOME/env" ]]; then
|
||||
for _easyzsh_f in "$EASYZSH_HOME/env"/*.zsh(N); do
|
||||
# shellcheck disable=SC1090
|
||||
. "$_easyzsh_f"
|
||||
done
|
||||
unset _easyzsh_f
|
||||
# Homebrew (macOS). cd /tmp so TCC-protected CWDs do not break brew shellenv.
|
||||
if [[ -x /opt/homebrew/bin/brew ]]; then
|
||||
eval "$(cd /tmp && /opt/homebrew/bin/brew shellenv)"
|
||||
elif [[ -x /usr/local/bin/brew ]]; then
|
||||
eval "$(cd /tmp && /usr/local/bin/brew shellenv)"
|
||||
fi
|
||||
|
||||
if [[ -f "$EASYZSH_HOME/local.zsh" ]]; then
|
||||
# User-local binaries (pipx, uv tools, grok shim, …).
|
||||
# Do not put vendor trees like ~/.grok/bin on PATH wholesale (names like `agent` shadow tools).
|
||||
if [[ -d "$HOME/.local/bin" ]]; then
|
||||
case ":${PATH}:" in
|
||||
*":$HOME/.local/bin:"*) ;;
|
||||
*) PATH="$HOME/.local/bin:${PATH}" ;;
|
||||
esac
|
||||
export PATH
|
||||
fi
|
||||
|
||||
if [[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/local.zsh" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "$EASYZSH_HOME/local.zsh"
|
||||
elif [[ -f "$HOME/.config/zshenv.local" ]]; then
|
||||
# Legacy path from earlier easyzsh layouts.
|
||||
# shellcheck disable=SC1090
|
||||
. "$HOME/.config/zshenv.local"
|
||||
. "${XDG_CONFIG_HOME:-$HOME/.config}/zsh/local.zsh"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user