From 403412bb587f5ebbf24bc543ece71aa88bdf18c0 Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Fri, 24 Feb 2023 18:16:28 -0500 Subject: [PATCH] Fix _command-exists --- zsh/zshrc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/zsh/zshrc b/zsh/zshrc index 34c423c..5d188de 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -45,7 +45,7 @@ zle -N down-line-or-beginning-search [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search _command-exists() { - [[ -x "$(command -v $1)" ]] && return true || return false + [[ -x "$(command -v $1)" ]] && return 0 || return 1 } export COMPLETION_WAITING_DOTS="true" @@ -93,7 +93,7 @@ if [[ -d ~/.cargo/bin ]]; then path=($path $HOME/.cargo/bin) fi -if [[ $(_command-exists starship) -eq 0 ]]; then +if (_command-exists starship); then znap eval starship 'starship init zsh --print-full-init' znap prompt starship else @@ -159,10 +159,13 @@ if [[ $(_command-exists mcfly) -eq 0 ]]; then export MCFLY_USED=1 fi -path+=($(yarn global bin)) -export PATH +if (_command-exists yarn); then + echo "found yarn: $(command -v yarn)" + path+=($(yarn global bin)) + export PATH +fi -if [[ $(_command-exists pdm) -eq 0 ]]; then +if (_command-exists pdm); then eval "$(pdm --pep582 zsh)" fi