From 7394248db18eb6ef8e5abe26648e71051a7d6715 Mon Sep 17 00:00:00 2001 From: Vincent Capelle Date: Wed, 13 Nov 2024 22:16:50 -0500 Subject: [PATCH] fix: Only run virtualenvwrapper and ruby if they exist --- zsh/zshenv | 6 ++++-- zsh/zshrc | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/zsh/zshenv b/zsh/zshenv index 8683e67..05c9cc9 100644 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -32,5 +32,7 @@ export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock # Ruby gems -export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" -export PATH="$PATH:$GEM_HOME/bin" +if [[ -x $(command -v ruby) ]]; then + export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" + export PATH="$PATH:$GEM_HOME/bin" +fi diff --git a/zsh/zshrc b/zsh/zshrc index 328ee02..127b5f6 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -39,7 +39,9 @@ zinit snippet OMZL::key-bindings.zsh bindkey '^H' backward-kill-word # Load virtualenvwrapper -source /usr/bin/virtualenvwrapper.sh +if [[ -x /usr/bin/virtualenvwrapper.sh ]]; then + source /usr/bin/virtualenvwrapper.sh +fi # Don't beep at me, bro! setopt nobeep