refactor(shell): thin stubs with managed ~/.config/zsh tree
Split always-on PATH/env, login hooks, and interactive UX into a managed tree under ~/.config/zsh, with never-overwrite local/ hooks. Agents and interactive shells share one PATH owner; deploy.sh applies the layout safely across machines.
This commit is contained in:
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
# Sole managed PATH builder for every zsh (including non-interactive agents).
|
||||
# Do not re-append user tool paths in .zprofile or .zshrc.
|
||||
|
||||
easyzsh_path_prepend() {
|
||||
local dir="$1"
|
||||
[[ -n "$dir" && -d "$dir" ]] || return 0
|
||||
case ":${PATH}:" in
|
||||
*":${dir}:"*) ;;
|
||||
*) PATH="${dir}:${PATH}" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Homebrew first so its shellenv can set prefix vars; we re-assert ~/.local/bin after.
|
||||
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
|
||||
|
||||
# User-local binaries (pipx, uv tools, intentional shims such as grok).
|
||||
# Never put vendor trees like ~/.grok/bin on PATH wholesale (generic names shadow tools).
|
||||
easyzsh_path_prepend "${HOME}/.local/bin"
|
||||
|
||||
export PATH
|
||||
Reference in New Issue
Block a user