From d0f050f18e1fc30781f3c92380a5a819ec1226dc Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 14 Oct 2024 00:56:13 -0500 Subject: [PATCH] check for chatgpt/pyenv tool existence before applying completion/sourcing logic --- home/.chezmoitemplates/scripts/commonrc.sh.tmpl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/home/.chezmoitemplates/scripts/commonrc.sh.tmpl b/home/.chezmoitemplates/scripts/commonrc.sh.tmpl index 89cc10d..55b1b1e 100644 --- a/home/.chezmoitemplates/scripts/commonrc.sh.tmpl +++ b/home/.chezmoitemplates/scripts/commonrc.sh.tmpl @@ -29,14 +29,18 @@ export PATH="$HOME/.local/share/bob/nvim-bin:$PATH" # Bob, the Neovim package m . "$HOME/.cargo/env" # Rustup + Cargo + Cargo-installed tools eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" # Brew command -v rbenv &> /dev/null && eval "$(rbenv init -)" # rbenv for Ruby -. <(chatgpt --set-completions {{ . -}}) # chatgpt completions +command -v chatgpt &> /dev/null && . <(chatgpt --set-completions {{ . -}}) # chatgpt completions # pyenv, python version manager export PYENV_ROOT="$HOME/.pyenv" -[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init -)" -# pyenv virtual-env -eval "$(pyenv virtualenv-init -)" +if [[ -d $PYENV_ROOT/bin ]]; then + export PATH="$PYENV_ROOT/bin:$PATH" + if command -v pyenv &> /dev/null; then + eval "$(pyenv init -)" + # pyenv virtual-env + eval "$(pyenv virtualenv-init -)" + fi +fi # bun export BUN_INSTALL="$HOME/.bun"