From 99c827b2bf2f56f17a5f891eb65cf830595fe3a8 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Mon, 14 Oct 2024 22:16:44 +0100 Subject: [PATCH] bash/zsh: add ~/.cargo/bin to PATH if present --- bashrc | 3 --- bashrc.d/cargo.bash | 1 + zshrc.d/cargo.zsh | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 zshrc.d/cargo.zsh diff --git a/bashrc b/bashrc index 1b84d1f..fa994ee 100644 --- a/bashrc +++ b/bashrc @@ -110,6 +110,3 @@ if [ -f ${HOME}/.bashrc.d/local/${HOSTNAME}.bash ] ; then fi # export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket" - -# Fig post block. Keep at the bottom of this file. -[[ -f "$HOME/.fig/shell/bashrc.post.bash" ]] && builtin source "$HOME/.fig/shell/bashrc.post.bash" diff --git a/bashrc.d/cargo.bash b/bashrc.d/cargo.bash index 52e3cb9..9ef1625 100644 --- a/bashrc.d/cargo.bash +++ b/bashrc.d/cargo.bash @@ -2,3 +2,4 @@ # uninstall by removing these lines [ -f ~/.config/tabtab/__tabtab.bash ] && . ~/.config/tabtab/__tabtab.bash || true [ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env" || true +[ -d "$HOME/.cargo/bin" ] && addpath "$HOME/.cargo/bin" || true diff --git a/zshrc.d/cargo.zsh b/zshrc.d/cargo.zsh new file mode 100644 index 0000000..87da2ec --- /dev/null +++ b/zshrc.d/cargo.zsh @@ -0,0 +1,3 @@ +[ -f ~/.config/tabtab/__tabtab.zsh ] && . ~/.config/tabtab/__tabtab.zsh || true +[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env" || true +[ -d "$HOME/.cargo/bin" ] && addpath "$HOME/.cargo/bin" || true