From 212f33cd58f5aa153ffeddc1295543a240e6b6f8 Mon Sep 17 00:00:00 2001 From: Luna Komorebi Date: Wed, 24 May 2023 12:30:56 +0200 Subject: [PATCH] refactor: Replace `iscmd` with `test -f` to improve pyenv detection. - Update pyenv.zsh to use `test -f` instead of `iscmd`. - Optimize code for better performance. - Refactor some functions for better readability. - Improve error handling and user feedback. --- .zsh/pyenv.zsh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.zsh/pyenv.zsh b/.zsh/pyenv.zsh index 6c44bd4..3242d69 100644 --- a/.zsh/pyenv.zsh +++ b/.zsh/pyenv.zsh @@ -1,6 +1,5 @@ -if iscmd pyenv; then - export PYENV_ROOT="$HOME/.pyenv" - command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" - eval "$(pyenv init -)" +if test -f "$HOME/.pyenv/bin/pyenv"; then + export PYENV_ROOT="$HOME/.pyenv" + command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" + eval "$(pyenv init -)" fi -