{bash,zsh}rc: evil hack for homebrew compatibility

This commit is contained in:
Aminda Suomalainen 2025-06-08 12:17:47 +03:00
parent 8a13f40da8
commit b8f71534f9
Signed by: Mikaela
GPG Key ID: 99392F62BAE30723
2 changed files with 10 additions and 0 deletions

View File

@ -342,6 +342,11 @@ if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
fi
# linuxbrew toolbox compatibility
if [[ -d /run/host/var/home/linuxbrew && ! -d /home/linuxbrew ]]; then
sudo ln -nsfv /run/host/var/home/linuxbrew /home/linuxbrew
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

@ -305,6 +305,11 @@ if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
fi
# linuxbrew toolbox compatibility
if [[ -d /run/host/var/home/linuxbrew && ! -d /home/linuxbrew ]]; then
sudo ln -nsfv /run/host/var/home/linuxbrew /home/linuxbrew
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]}')