From 20f0a7a91368c53279a5754a7ab823b8aa93e828 Mon Sep 17 00:00:00 2001 From: James Dixon Date: Sat, 26 Nov 2022 10:43:20 -0500 Subject: [PATCH] change path/command detection in bashrc --- config/bash/.bashrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/bash/.bashrc b/config/bash/.bashrc index e92d26d..ffc3085 100644 --- a/config/bash/.bashrc +++ b/config/bash/.bashrc @@ -336,7 +336,7 @@ src_pyenv() { } # go -if command -v go > /dev/null; then +if command -v go && [ -d "$(go env GOPATH)/bin" ]; then [ -d "$HOME/go" ] && mv "$HOME/go" "$HOME/.go" export GOPATH="$HOME/.go" export GOWD="$GOPATH/src/github.com/lemonase" @@ -345,9 +345,7 @@ if command -v go > /dev/null; then fi # rust -if command -v cargo > /dev/null; then - appendpath "$HOME/.cargo/bin" -fi +[ -d "$HOME/.cargo" ] && appendpath "$HOME/.cargo/bin" ## macOS package managers ## # homebrew