{bash,zsh}rc: add yet untested detection for programming language version managers installed through linuxbrew

This commit is contained in:
Aminda Suomalainen 2024-07-28 08:32:41 +03:00
parent 286694a0c0
commit 15a8d5f9eb
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 32 additions and 6 deletions

View File

@ -275,20 +275,29 @@ if [ -d ~/.goenv/bin ]; then
eval "$(goenv init -)" eval "$(goenv init -)"
PATH="$GOROOT/bin:$PATH" PATH="$GOROOT/bin:$PATH"
PATH="$PATH:$GOPATH/bin" PATH="$PATH:$GOPATH/bin"
elif hash goenv 2> /dev/null; then
eval $(goenv init -)
fi fi
# https://github.com/nvm-sh/nvm # https://github.com/nvm-sh/nvm
if [ -d ~/.nvm ]; then if [ -d ~/.nvm ]; then
. ~/.nvm/nvm.sh . ~/.nvm/nvm.sh
. ~/.nvm/bash_completion . ~/.nvm/bash_completion
elif [ -f /home/linuxbrew/.linuxbrew/bin/nvm ]; then
mkdir -p /home/linuxbrew/.nvm
export NVM_DIR=/home/linuxbrew/.nvm
[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
fi fi
# https://github.com/rbenv/rbenv # https://github.com/rbenv/rbenv
if [ -d ~/.rbenv/bin ]; then if [ -d ~/.rbenv/bin ]; then
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH" PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
rbenv init > /dev/null 2>&1 eval "$(rbenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build # git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
elif hash rbenv 2> /dev/null; then
eval "$(rbenv init -)"
fi fi
# Add RubyGems to PATH # Add RubyGems to PATH
@ -299,18 +308,22 @@ fi
# https://github.com/pyenv/pyenv # https://github.com/pyenv/pyenv
if [ -d ~/.pyenv/bin ]; then if [ -d ~/.pyenv/bin ]; then
PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH" PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH"
pyenv init > /dev/null 2>&1 eval "$(pyenv init -)"
# Worth considering (and verifying before running) # Worth considering (and verifying before running)
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv # git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper # git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
elif hash pyenv 2> /dev/null; then
eval "$(pyenv init -)"
fi fi
# https://github.com/nodenv/nodenv # https://github.com/nodenv/nodenv
if [ -d ~/.nodenv/bin ]; then if [ -d ~/.nodenv/bin ]; then
PATH="$HOME/.nodenv/bin:$PATH" PATH="$HOME/.nodenv/bin:$PATH"
eval "$(nodenv init - bash)" eval "$(nodenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build # git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
elif hash nodenv 2> /dev/null; then
eval "$(nodenv init -)"
fi fi
# https://github.com/Homebrew/brew # https://github.com/Homebrew/brew

View File

@ -229,20 +229,29 @@ if [ -d ~/.goenv/bin ]; then
eval "$(goenv init -)" eval "$(goenv init -)"
PATH="$GOROOT/bin:$PATH" PATH="$GOROOT/bin:$PATH"
PATH="$PATH:$GOPATH/bin" PATH="$PATH:$GOPATH/bin"
elif hash goenv 2> /dev/null; then
eval $(goenv init -)
fi fi
# https://github.com/nvm-sh/nvm # https://github.com/nvm-sh/nvm
if [ -d ~/.nvm ]; then if [ -d ~/.nvm ]; then
. ~/.nvm/nvm.sh . ~/.nvm/nvm.sh
. ~/.nvm/bash_completion . ~/.nvm/bash_completion
elif [ -d /home/linuxbrew/.linuxbrew/bin/nvm ]; then
mkdir -p /home/linuxbrew/.nvm
export NVM_DIR=/home/linuxbrew/.nvm
[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
fi fi
# https://github.com/rbenv/rbenv # https://github.com/rbenv/rbenv
if [ -d ~/.rbenv/bin ]; then if [ -d ~/.rbenv/bin ]; then
PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH" PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
rbenv init > /dev/null 2>&1 eval "$(rbenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build # git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
elif hash rbenv 2> /dev/null; then
eval "$(rbenv init -)"
fi fi
# Add RubyGems to PATH # Add RubyGems to PATH
@ -253,18 +262,22 @@ fi
# https://github.com/pyenv/pyenv # https://github.com/pyenv/pyenv
if [ -d ~/.pyenv/bin ]; then if [ -d ~/.pyenv/bin ]; then
PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH" PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH"
pyenv init > /dev/null 2>&1 eval "$(pyenv init -)"
# Worth considering (and verifying before running) # Worth considering (and verifying before running)
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv # git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper # git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
elif hash pyenv 2> /dev/null; then
eval "$(pyenv init -)"
fi fi
# https://github.com/nodenv/nodenv # https://github.com/nodenv/nodenv
if [ -d ~/.nodenv/bin ]; then if [ -d ~/.nodenv/bin ]; then
PATH="$HOME/.nodenv/bin:$PATH" PATH="$HOME/.nodenv/bin:$PATH"
eval "$(nodenv init - zsh)" eval "$(nodenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build # git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
elif hash nodenv 2> /dev/null; then
eval "$(nodenv init -)"
fi fi
# https://github.com/Homebrew/brew # https://github.com/Homebrew/brew