Compare commits
2
Commits
82c6a57c3a
...
1ba7380ac5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ba7380ac5 | ||
|
|
d5afd25bbe |
@@ -40,13 +40,10 @@ plugins=(
|
|||||||
|
|
||||||
fpath+=$ZSH/custom/plugins/zsh-completions/src
|
fpath+=$ZSH/custom/plugins/zsh-completions/src
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]] && command -v brew &> /dev/null; then
|
if [[ "$OSTYPE" == "darwin"* && -n "$HOMEBREW_PREFIX" ]]; then
|
||||||
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
|
fpath=("$HOMEBREW_PREFIX/share/zsh/site-functions" ${fpath:#$HOMEBREW_PREFIX/share/zsh/site-functions})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p ~/.cache/zsh
|
|
||||||
autoload -U compinit && compinit -C -d ~/.cache/zsh/.zcompdump
|
|
||||||
|
|
||||||
SAVEHIST=50000
|
SAVEHIST=50000
|
||||||
|
|
||||||
cheat() {
|
cheat() {
|
||||||
|
|||||||
@@ -214,6 +214,26 @@ HOME="$pyenv_env_home" XDG_CONFIG_HOME="$pyenv_env_xdg" \
|
|||||||
zsh -lc '[[ "$(command -v python3)" == "$HOME/.pyenv/shims/python3" ]]' ||
|
zsh -lc '[[ "$(command -v python3)" == "$HOME/.pyenv/shims/python3" ]]' ||
|
||||||
fail "pyenv Python is not restored in login zsh after the system profile"
|
fail "pyenv Python is not restored in login zsh after the system profile"
|
||||||
|
|
||||||
|
# Interactive initialization runs once while repeated sourcing restores PATH.
|
||||||
|
mkdir -p "$pyenv_env_home/.pyenv/bin"
|
||||||
|
cat >"$pyenv_env_home/.pyenv/bin/pyenv" <<'PYENV'
|
||||||
|
#!/bin/sh
|
||||||
|
printf '%s\n' "$*" >> "$PYENV_ROOT/init-calls"
|
||||||
|
printf '%s\n' 'pyenv() { command pyenv "$@"; }'
|
||||||
|
PYENV
|
||||||
|
chmod +x "$pyenv_env_home/.pyenv/bin/pyenv"
|
||||||
|
HOME="$pyenv_env_home" PYENV_ROOT="$pyenv_env_home/.pyenv" PATH=/usr/bin:/bin \
|
||||||
|
zsh -dfic '
|
||||||
|
source "$1"
|
||||||
|
(( $+functions[pyenv] )) || exit 1
|
||||||
|
path=(/usr/bin /bin)
|
||||||
|
source "$1"
|
||||||
|
[[ $(command -v python3) == "$PYENV_ROOT/shims/python3" ]]
|
||||||
|
' zsh "$ROOT/zsh/pyenv.zsh" ||
|
||||||
|
fail "interactive pyenv initialization did not preserve its function and Python PATH"
|
||||||
|
printf '%s\n' 'init - --no-rehash zsh' | cmp -s - "$pyenv_env_home/.pyenv/init-calls" ||
|
||||||
|
fail "pyenv initialization must run once without a startup rehash"
|
||||||
|
|
||||||
# A later easyzsh migration must not move the login hook before the system profile.
|
# A later easyzsh migration must not move the login hook before the system profile.
|
||||||
HOME="$pyenv_env_home" bash "$ROOT/deploy.sh" --home "$pyenv_env_home" --migrate-zprofile >/dev/null
|
HOME="$pyenv_env_home" bash "$ROOT/deploy.sh" --home "$pyenv_env_home" --migrate-zprofile >/dev/null
|
||||||
grep -Fqx "$pyenv_login_hook" "$pyenv_env_home/.zprofile" ||
|
grep -Fqx "$pyenv_login_hook" "$pyenv_env_home/.zprofile" ||
|
||||||
|
|||||||
+4
-2
@@ -3,6 +3,8 @@ export PYENV_ROOT="${PYENV_ROOT:-$HOME/.pyenv}"
|
|||||||
[[ -d "$PYENV_ROOT/bin" ]] && path=("$PYENV_ROOT/bin" ${path:#$PYENV_ROOT/bin})
|
[[ -d "$PYENV_ROOT/bin" ]] && path=("$PYENV_ROOT/bin" ${path:#$PYENV_ROOT/bin})
|
||||||
[[ -d "$PYENV_ROOT/shims" ]] && path=("$PYENV_ROOT/shims" ${path:#$PYENV_ROOT/shims})
|
[[ -d "$PYENV_ROOT/shims" ]] && path=("$PYENV_ROOT/shims" ${path:#$PYENV_ROOT/shims})
|
||||||
export PATH
|
export PATH
|
||||||
if [[ -o interactive ]] && command -v pyenv &> /dev/null; then
|
# Login profiles can reapply PATH without repeating shell integration.
|
||||||
eval "$(pyenv init - zsh)"
|
# Run `pyenv rehash` after installing entry points through `python -m pip`.
|
||||||
|
if [[ -o interactive ]] && (( ! $+functions[pyenv] )) && command -v pyenv &> /dev/null; then
|
||||||
|
eval "$(pyenv init - --no-rehash zsh)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user