{bash,zsh}rc: add support for linuxbrew

This commit is contained in:
Aminda Suomalainen 2024-07-28 07:18:12 +03:00
parent f9fefeeba7
commit 21e36c11ba
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 12 additions and 0 deletions

View File

@ -313,6 +313,12 @@ if [ -d ~/.nodenv/bin ]; then
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
fi
# https://github.com/Homebrew/brew
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
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]}')

View File

@ -267,6 +267,12 @@ if [ -d ~/.nodenv/bin ]; then
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
fi
# https://github.com/Homebrew/brew
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
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]}')