{bash,zsh}rc: fix $PATH mainly for rbenv

This commit is contained in:
Aminda Suomalainen 2024-07-06 10:04:55 +03:00
parent b65b306c9e
commit 22425e5d12
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 18 additions and 18 deletions

View File

@ -210,14 +210,6 @@ TZ=$(date +%Z)
# Sets PATH. To add another path, add :</path/to/new/path> to string below. # Sets PATH. To add another path, add :</path/to/new/path> to string below.
PATH=$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/local/bin:/usr/local/sbin:/usr/local/games:/snap/bin:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/games:$PATH PATH=$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/local/bin:/usr/local/sbin:/usr/local/games:/snap/bin:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/games:$PATH
# Add RubyGems to PATH
if hash ruby 2> /dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
fi
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
# Colours to less # Colours to less
# Copied from https://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html # Copied from https://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html
export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_mb=$'\E[01;31m'
@ -276,12 +268,17 @@ 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:$PATH" PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
rbenv init > /dev/null 2>&1 rbenv init > /dev/null 2>&1
# 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
fi fi
# Add RubyGems to PATH
if hash ruby 2> /dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
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:$PATH" PATH="$HOME/.pyenv/bin:$PATH"
@ -296,6 +293,9 @@ if [ -d ~/.nodenv/bin ]; then
# 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
fi fi
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
##### Aliases RJ706I ##### ##### Aliases RJ706I #####
# To get sudo work with aliases. # To get sudo work with aliases.

View File

@ -177,14 +177,6 @@ TZ=$(date +%Z)
# Sets PATH. To add another path, add :</path/to/new/path> to string below. # Sets PATH. To add another path, add :</path/to/new/path> to string below.
PATH=$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/local/bin:/usr/local/sbin:/usr/local/games:/snap/bin:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/games:$PATH PATH=$HOME/.local/bin:$HOME/bin:$HOME/go/bin:$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/local/bin:/usr/local/sbin:/usr/local/games:/snap/bin:/usr/bin:/usr/sbin:/usr/games:/bin:/sbin:/games:$PATH
# Add RubyGems to PATH
if hash ruby 2>/dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
fi
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
# Colours to less # Colours to less
# Copied from https://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html # Copied from https://nion.modprobe.de/blog/archives/572-less-colors-for-man-pages.html
export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_mb=$'\E[01;31m'
@ -242,12 +234,17 @@ 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:$PATH" PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
rbenv init >/dev/null 2>&1 rbenv init >/dev/null 2>&1
# 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
fi fi
# Add RubyGems to PATH
if hash ruby 2>/dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
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:$PATH" PATH="$HOME/.pyenv/bin:$PATH"
@ -262,6 +259,9 @@ if [ -d ~/.nodenv/bin ]; then
# 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
fi fi
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
##### Aliases RJ706I ##### ##### Aliases RJ706I #####
# To get sudo work with aliases. # To get sudo work with aliases.