From cf8e4848532064ef0d352b6a36d814e3e170a053 Mon Sep 17 00:00:00 2001 From: mlunax Date: Sat, 15 Apr 2023 02:14:43 +0200 Subject: [PATCH] fix a little script loading --- .zsh/pyenv.zsh | 9 ++++++--- .zsh/rtx.zsh | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.zsh/pyenv.zsh b/.zsh/pyenv.zsh index 37edfe4..6c44bd4 100644 --- a/.zsh/pyenv.zsh +++ b/.zsh/pyenv.zsh @@ -1,3 +1,6 @@ -export PYENV_ROOT="$HOME/.pyenv" -command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init -)" +if iscmd pyenv; then + export PYENV_ROOT="$HOME/.pyenv" + command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init -)" +fi + diff --git a/.zsh/rtx.zsh b/.zsh/rtx.zsh index 8a72831..b5dd116 100644 --- a/.zsh/rtx.zsh +++ b/.zsh/rtx.zsh @@ -1,5 +1,7 @@ export RTX_SHELL=zsh +if iscmd rtx; then + rtx() { local command command="${1:-}" @@ -32,3 +34,4 @@ typeset -ag chpwd_functions; if [[ -z "${chpwd_functions[(r)_rtx_hook]+1}" ]]; then chpwd_functions=( _rtx_hook ${chpwd_functions[@]} ) fi +fi