File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 33# Completion is in sh to account for the zsh syntax & when zsh tries to source scripts from /etc/profiles
44
55# Check for interactive bash and that we haven't already been sourced.
6- if [ " x${BASH_VERSION-} " != x -a " x${PS1-} " != x -a " x${BREW_BASH_COMPLETION-} " = x ]; then
6+ if [ " x${BASH_VERSION-} " != x -a " x${PS1-} " != x -a " x${BREW_BASH_COMPLETION-} " = x -a " $( /usr/bin/id -u ) " != 0 ]; then
77
88 # Check for recent enough version of bash.
99 if [ " ${BASH_VERSINFO[0]} " -gt 4 ] ||
Original file line number Diff line number Diff line change 11# !/usr/bin/env fish
22# shellcheck disable=all
3- if status --is-interactive
3+ if status --is-interactive and if test $(/usr/bin/ id -u ) -ne 0
44 if [ -d /home/linuxbrew/.linuxbrew ]
55 eval " $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
66 if test -d (brew --prefix )/share/fish/completions
Original file line number Diff line number Diff line change @@ -215,7 +215,9 @@ if [[ ! -f "/etc/profile.d/brew.sh" ]]; then
215215 echo " Apply brew path export fix, to solve path conflicts between system & brew programs with same name"
216216 cat > /etc/profile.d/brew.sh << EOF
217217#!/usr/bin/env bash
218- [[ -d /home/linuxbrew/.linuxbrew && \$ - == *i* ]] && eval "\$ (/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
218+ if [[ -d /home/linuxbrew/.linuxbrew && \$ - == *i* && "\$ (/usr/bin/id -u)" != 0 ]]; then
219+ eval "\$ (/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
220+ fi
219221EOF
220222fi
221223
You can’t perform that action at this time.
0 commit comments