From 21e36c11ba4ac7ce6f0ebd0f2b91d82cca1afcf6 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sun, 28 Jul 2024 07:18:12 +0300 Subject: [PATCH] {bash,zsh}rc: add support for linuxbrew --- rc/bashrc | 6 ++++++ rc/zshrc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/rc/bashrc b/rc/bashrc index a10980a1..eda99aeb 100755 --- a/rc/bashrc +++ b/rc/bashrc @@ -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]}') diff --git a/rc/zshrc b/rc/zshrc index 763c7da6..ae69b91e 100755 --- a/rc/zshrc +++ b/rc/zshrc @@ -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]}')