From 6fc0a512ab3e0e2c7b09b585f1a3ff1dac21b76d Mon Sep 17 00:00:00 2001 From: James Dixon Date: Wed, 24 Jun 2020 02:16:21 -0400 Subject: [PATCH] update bash_profile --- bash/bash_profile | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/bash/bash_profile b/bash/bash_profile index f6883ea..eadf272 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -1,40 +1,31 @@ [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc" appendpath () { + if [ -d "$1" ]; then case ":$PATH:" in *:"$1":*) ;; *) PATH="${PATH:+$PATH:}$1" esac + fi } -user_paths=() +appendpath "$HOME/.local/bin" +appendpath "$HOME/.local/scripts" -# home paths -# ---------- - -user_paths+=("$HOME/bin" "$HOME/.local/bin") -user_paths+=("$HOME/scripts" "$HOME/.local/scripts") - -# language paths -# -------------- - -# ruby if command -v ruby > /dev/null && command -v gem > /dev/null; then appendpath "$(ruby -r rubygems -e 'puts Gem.user_dir')/bin" fi -# rust -user_paths+=("$HOME/.cargo/bin") +if command -v go > /dev/null; then + export GOPATH="$HOME/.go" + [ -d "$HOME/go" ] && mv "$HOME/go" "$HOME/.go" + appendpath "$(go env GOPATH)/bin" +fi -# go -user_paths+=("$HOME/go/bin" "$HOME/.local/go/bin") - -for path in "${user_paths[@]}"; do - if [ -d "$path" ]; then - appendpath "$path" - fi -done +if command -v cargo > /dev/null; then + appendpath "$HOME/.cargo/bin" +fi # vim:ft=sh